Closed Weiming-Hu closed 4 years ago
Then, the default compiler on Onxy is Intel. However, we have the following issue during the make process.
[ 48%] Building CXX object CAnEnIO/CMakeFiles/AnEnIO.dir/__/CAnEn/src/SimilarityMatrices.cpp.o
[ 48%] Building CXX object CAnEnIO/CMakeFiles/AnEnIO.dir/__/CAnEn/src/errorType.cpp.o
/p/work/bhoch/AE6.1/anen/AnalogsEnsemble/CAnEnIO/src/AnEnIO.cpp(2353): error: parallel loops with collapse must be perfectly nested
for (size_t i = 0; i < data.shape()[same_dimensions[2]]; i++) {
^
Error: the OpenMP "single" pragma must not be enclosed by the "for" pragma
Error: the OpenMP "single" pragma must not be enclosed by the "for" pragma
CAnEnIO/CMakeFiles/AnEnIO.dir/build.make:62: recipe for target 'CAnEnIO/CMakeFiles/AnEnIO.dir/src/AnEnIO.cpp.o' failed
make[2]: *** [CAnEnIO/CMakeFiles/AnEnIO.dir/src/AnEnIO.cpp.o] Error 2
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:218: recipe for target 'CAnEnIO/CMakeFiles/AnEnIO.dir/all' failed
make[1]: *** [CAnEnIO/CMakeFiles/AnEnIO.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
This is because the OpenMP interface between Intel and GNU compilers are not the same which creates the error.
Another issue will be created specifically for the support with Intel.
But at this point, let's use GNU compilers.
CC=<the GNU C compiler> CXX=<the GNU C++ compiler> cmake <the rest of the arguments> ..
The make process went a bit further unitl it broke. This time, it is because of the linking to Boost.
[ 91%] Linking CXX executable ../../../output/bin/windFieldCalculator
[ 92%] Linking CXX executable ../../../output/test/runFunctions
/usr/bin/ld: CMakeFiles/analogSelector.dir/analogSelector.cpp.o: in function `void boost::program_options::validate<unsigned long, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned long*, long) [clone .constprop.318]':
analogSelector.cpp:(.text+0x9a5): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: CMakeFiles/analogSelector.dir/analogSelector.cpp.o: in function `boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
analogSelector.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x21): undefined reference to `boost::program_options::validation_error::get_template[abi:cxx11](boost::program_options::validation_error::kind_t)'
/usr/bin/ld: analogSelector.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x39): undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: CMakeFiles/analogSelector.dir/analogSelector.cpp.o: in function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
Notice a message from previous output that we are using the Intel Boost package.
The linking flags for AnEnIO: /p/app/unsupported/COST/boost/1.58.0/intel/lib/libboost_program_options.a;/p/app/unsupported/COST/boost/1.58.0/intel/lib/libboost_system.a;/p/app/unsupported/COST/boost/1.58.0/intel/lib/libboost_filesystem.a;netcdf_cxx4_built;/p/app/unsupported/netcdf/4.6.2-intel-18.0.2.199/lib/libnetcdf.a;
But right now we are using GNU compilers rather than Intel compilers. We need to load GNU Boost.
After the package swapping, the program compiles with all tests passed.
Close this issue since the program compiles. For more information on Intel compilers, please refer to issue 67.
This is to document the process of building PAnEn C++ on Onyx.
Two problems emerged during the process.
First is that it seems like cross-compilation does not work out of the box on Onyx and therefore, dynamic linking to Boost is disabled. We are limited to use the system package for Boost.
So you need to load the
Boost
module.