Project

General

Profile

Support #10594

NOvA code is not compiling with gcc 4.9.3 on OS X due to conflict between int64_t and long types

Added by Brian Rebel about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Third Party
Target version:
-
Start date:
10/20/2015
Due date:
% Done:

100%

Estimated time:
Spent time:
Scope:
Internal
Experiment:
NOvA
SSI Package:
Duration:

Description

I am having trouble compiling NOvA code on OS X 10.10.5. The result of name -r is 14.0.5 and Xcode version is 7.0.1 (7A1001). A tarball of the code is attached to this issue. The build can be setup by doing

source novadaq/ups/setup_for_development -d(p) e9

novadaq.tar.bz2 (2.02 MB) novadaq.tar.bz2 Brian Rebel, 10/20/2015 03:32 PM

History

#1 Updated by Brian Rebel about 5 years ago

Here is the output when I see the error:

/Users/brebel/nova/novadaq/novadaq/NovaDatabase/cxx/src/Table.cpp:1720:6: error: prototype for ‘bool nova::database::Table::GetCurrSeqVal(std::string, int64_t&)’ does not match any in class ‘nova::database::Table’
bool Table::GetCurrSeqVal(std::string col, int64_t& iseq)
^
In file included from /Users/brebel/nova/novadaq/novadaq/NovaDatabase/cxx/src/Table.cpp:18:0:
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/Table.h:169:12: error: candidates are: bool nova::database::Table::GetCurrSeqVal(const char*, long int&)
bool GetCurrSeqVal(const char* col, long& iseq)
^
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/Table.h:168:12: error: bool nova::database::Table::GetCurrSeqVal(std::string, long int&)
bool GetCurrSeqVal(std::string col, long& iseq);
^
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/cxx/src/Table.cpp: In member function ‘bool nova::database::Table::WriteToDB(bool)’:
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/cxx/src/Table.cpp:1980:46: error: no matching function for call to ‘nova::database::Table::GetCurrSeqVal(std::string, int64_t&)’
if (this->GetCurrSeqVal(fCol[j].Name(),iseq)) {
^
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/cxx/src/Table.cpp:1980:46: note: candidates are:
In file included from /Users/brebel/nova/novadaq/novadaq/NovaDatabase/cxx/src/Table.cpp:18:0:
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/Table.h:168:12: note: bool nova::database::Table::GetCurrSeqVal(std::string, long int&)
bool GetCurrSeqVal(std::string col, long& iseq);
^
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/Table.h:168:12: note: no known conversion for argument 2 from ‘int64_t {aka long long int}’ to ‘long int&’
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/Table.h:169:12: note: bool nova::database::Table::GetCurrSeqVal(const char*, long int&)
bool GetCurrSeqVal(const char* col, long& iseq)
^
/Users/brebel/nova/novadaq/novadaq/NovaDatabase/Table.h:169:12: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
ninja: build stopped: subcommand failed.

Note that in the .h file the function is defined as

bool Table::GetCurrSeqVal(std::string col, long& iseq)

but in the .cpp file it is

bool Table::GetCurrSeqVal(std::string col, int64_t& iseq)

I tried changing the .h file to be int64_t, but that did not work. I am not super eager to change the int64_t variables that are used with this function call to long type throughout the code, as that could cause other issues. Any other suggestions?

#2 Updated by Christopher Green about 5 years ago

  • Category set to Third Party
  • Status changed from New to Resolved
  • Assignee set to Christopher Green
  • % Done changed from 0 to 100

This is understood after sitting down with Brian: the header did need to be changed, but Brian's compile wasn't using the header he thought he was, so the changes he made weren't being honored.

We should discuss a different method of allowing a CMake build to find online headers in <pkg>/cxx/include than manually copying them to a different place in the source.

#3 Updated by Kyle Knoepfel almost 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF