Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
Hello all,
FYI, same error message can also be seen by compiling in the command line with g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Moreover, with g++ --version the information of my compiler is given below:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Any suggestion? Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 17:40 GMT-04:00 Leo Fang leofang@phy.duke.edu:
Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
Hi Leo,
The error messages indicate that you did not link against the MPI libraries.
Matthias
On 17 Jun 2015, at 17:45, Leo Fang leofang@phy.duke.edu wrote:
Hello all,
FYI, same error message can also be seen by compiling in the command line with g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Moreover, with g++ --version the information of my compiler is given below:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Any suggestion? Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 17:40 GMT-04:00 Leo Fang <leofang@phy.duke.edu mailto:leofang@phy.duke.edu>: Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
Hello Dr. Troyer,
Thank you very much for your reply. Forgive my stupidity, but aren't the paths to MPI headers and the MPI libraries already specified by the -I and -L flags? How come the MPI library is not linked?
I have examined the possibility that my compile command wasn't complete enough. Therefore, I tried following the instruction on the ALPS website ( http://alps.comp-phys.org/mediawiki/index.php/Tutorials:Using_ALPS_in_your_p...) to create a CMakeLists.txt file in which it pointed to hybmain.cpp. I put all source code and the txt file in the path ~/just_a_folder/, set $ALPS_HOME to /opt/alps, and ran cmake ~/just_a_folder/. It created a bunch of files in the same folder which I have not fully figured out what they represent yet, but I noticed there was a Makefile, so I further ran make. This time the error message was different:
Scanning dependencies of target hyb_test [ 50%] Building CXX object CMakeFiles/hyb_test.dir/hybmain.cpp.o [100%] Linking CXX executable hyb_test ld: framework not found vecLib clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
where the executable was named hyb_test. By looking at the file /opt/alps/share/alps/include.mk, I noticed that the flag vecLib represents lapack.
Google told me the vecLib framework is in /System/Library/Frameworks/vecLib.framework/, and I checked that it does exist. However, Google also told me that vecLib has been deprecated (see the Apple documentation here https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html#//apple_ref/doc/uid/TP40001067-CH210-BBCGHCCJ) and one should instead use the Accelerate framework. Therefore, having no way to get around, I decided to manually modify the file ~/just_a_folder/CMakeFiles/hyb_test.dir/link.txt and to use -framework Accelerate. Now I encounter the same problem with much fewer functions missing (for example, Alps, Boost and MPI are found):
[ 50%] Linking CXX executable hyb_test Undefined symbols for architecture x86_64: "evaluate_2p(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnt(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnw(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_freq(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_time(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_basics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_legendre(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_sector_statistics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "hybridization::update()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::measure()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::hybridization(alps::params const&, int)", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::mcmpiadapter(alps::params const&, boost::mpi::communicator const&, alps::check_schedule const&) in hybmain.cpp.o "hybridization::fraction_completed() const", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::run(boost::function<bool ()> const&) in hybmain.cpp.o "typeinfo for hybridization", referenced from: typeinfo for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "vtable for hybridization", referenced from: hybridization::~hybridization() in hybmain.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
These functions were already missing when I compiled with the simple command g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Now with the aid of cmake it seems less likely that a library is not linked. What can I do now?
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 21:26 GMT-04:00 Matthias Troyer troyer@phys.ethz.ch:
Hi Leo,
The error messages indicate that you did not link against the MPI libraries.
Matthias
On 17 Jun 2015, at 17:45, Leo Fang leofang@phy.duke.edu wrote:
Hello all,
FYI, same error message can also be seen by compiling in the command line with g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Moreover, with g++ --version the information of my compiler is given below:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Any suggestion? Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 17:40 GMT-04:00 Leo Fang leofang@phy.duke.edu:
Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
When linking manually, as you seem to do, -L just gives the directory in which it should look for libraries, but does not specify the libraries that should be linked.
On Jun 17, 2015, at 19:32, Leo Fang leofang@phy.duke.edu wrote:
Hello Dr. Troyer,
Thank you very much for your reply. Forgive my stupidity, but aren't the paths to MPI headers and the MPI libraries already specified by the -I and -L flags? How come the MPI library is not linked?
I have examined the possibility that my compile command wasn't complete enough. Therefore, I tried following the instruction on the ALPS website (http://alps.comp-phys.org/mediawiki/index.php/Tutorials:Using_ALPS_in_your_p...) to create a CMakeLists.txt file in which it pointed to hybmain.cpp. I put all source code and the txt file in the path ~/just_a_folder/, set $ALPS_HOME to /opt/alps, and ran cmake ~/just_a_folder/. It created a bunch of files in the same folder which I have not fully figured out what they represent yet, but I noticed there was a Makefile, so I further ran make. This time the error message was different:
Scanning dependencies of target hyb_test [ 50%] Building CXX object CMakeFiles/hyb_test.dir/hybmain.cpp.o [100%] Linking CXX executable hyb_test ld: framework not found vecLib clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
where the executable was named hyb_test. By looking at the file /opt/alps/share/alps/include.mk, I noticed that the flag vecLib represents lapack.
Google told me the vecLib framework is in /System/Library/Frameworks/vecLib.framework/, and I checked that it does exist. However, Google also told me that vecLib has been deprecated (see the Apple documentation here) and one should instead use the Accelerate framework. Therefore, having no way to get around, I decided to manually modify the file ~/just_a_folder/CMakeFiles/hyb_test.dir/link.txt and to use -framework Accelerate. Now I encounter the same problem with much fewer functions missing (for example, Alps, Boost and MPI are found):
[ 50%] Linking CXX executable hyb_test Undefined symbols for architecture x86_64: "evaluate_2p(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnt(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnw(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_freq(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_time(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_basics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_legendre(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_sector_statistics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "hybridization::update()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::measure()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::hybridization(alps::params const&, int)", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::mcmpiadapter(alps::params const&, boost::mpi::communicator const&, alps::check_schedule const&) in hybmain.cpp.o "hybridization::fraction_completed() const", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::run(boost::function<bool ()> const&) in hybmain.cpp.o "typeinfo for hybridization", referenced from: typeinfo for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "vtable for hybridization", referenced from: hybridization::~hybridization() in hybmain.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
These functions were already missing when I compiled with the simple command g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Now with the aid of cmake it seems less likely that a library is not linked. What can I do now?
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 21:26 GMT-04:00 Matthias Troyer troyer@phys.ethz.ch:
Hi Leo,
The error messages indicate that you did not link against the MPI libraries.
Matthias
On 17 Jun 2015, at 17:45, Leo Fang leofang@phy.duke.edu wrote:
Hello all,
FYI, same error message can also be seen by compiling in the command line with g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Moreover, with g++ --version the information of my compiler is given below:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Any suggestion? Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 17:40 GMT-04:00 Leo Fang leofang@phy.duke.edu:
Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
Dear Dr. Troyer,
I see, thanks. But it still doesn't answer my question that why the code cannot be compiled even with cmake.
I've tested the hello-world code from https://alps.comp-phys.org/svn/alps1/trunk/alps/tutorials/alpsize-01-cmake/, and the code can be successfully compiled by running cmake, changing "vecLib" to "Accelerate" as I explained in my previous email (some suggests that Yosemite is to be blamed for this; one can even replace -framework Accelerate simply by -llapack and it seems working), and finally running make. The same CMakeLists.txt file, however, cannot compile the hybridization code, and the error message was given in my previous email. Note that I do *not* link manually!
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 23:02 GMT-04:00 Matthias Troyer troyer@phys.ethz.ch:
When linking manually, as you seem to do, -L just gives the directory in which it should look for libraries, but does not specify the libraries that should be linked.
On Jun 17, 2015, at 19:32, Leo Fang leofang@phy.duke.edu wrote:
Hello Dr. Troyer,
Thank you very much for your reply. Forgive my stupidity, but aren't the paths to MPI headers and the MPI libraries already specified by the -I and -L flags? How come the MPI library is not linked?
I have examined the possibility that my compile command wasn't complete enough. Therefore, I tried following the instruction on the ALPS website ( http://alps.comp-phys.org/mediawiki/index.php/Tutorials:Using_ALPS_in_your_p...) to create a CMakeLists.txt file in which it pointed to hybmain.cpp. I put all source code and the txt file in the path ~/just_a_folder/, set $ALPS_HOME to /opt/alps, and ran cmake ~/just_a_folder/. It created a bunch of files in the same folder which I have not fully figured out what they represent yet, but I noticed there was a Makefile, so I further ran make. This time the error message was different:
Scanning dependencies of target hyb_test [ 50%] Building CXX object CMakeFiles/hyb_test.dir/hybmain.cpp.o [100%] Linking CXX executable hyb_test ld: framework not found vecLib clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
where the executable was named hyb_test. By looking at the file /opt/alps/share/alps/include.mk, I noticed that the flag vecLib represents lapack.
Google told me the vecLib framework is in /System/Library/Frameworks/vecLib.framework/, and I checked that it does exist. However, Google also told me that vecLib has been deprecated (see the Apple documentation here https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html#//apple_ref/doc/uid/TP40001067-CH210-BBCGHCCJ) and one should instead use the Accelerate framework. Therefore, having no way to get around, I decided to manually modify the file ~/just_a_folder/CMakeFiles/hyb_test.dir/link.txt and to use -framework Accelerate. Now I encounter the same problem with much fewer functions missing (for example, Alps, Boost and MPI are found):
[ 50%] Linking CXX executable hyb_test Undefined symbols for architecture x86_64: "evaluate_2p(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnt(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnw(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_freq(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_time(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_basics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_legendre(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_sector_statistics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "hybridization::update()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::measure()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::hybridization(alps::params const&, int)", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::mcmpiadapter(alps::params const&, boost::mpi::communicator const&, alps::check_schedule const&) in hybmain.cpp.o "hybridization::fraction_completed() const", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::run(boost::function<bool ()> const&) in hybmain.cpp.o "typeinfo for hybridization", referenced from: typeinfo for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "vtable for hybridization", referenced from: hybridization::~hybridization() in hybmain.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
These functions were already missing when I compiled with the simple command g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Now with the aid of cmake it seems less likely that a library is not linked. What can I do now?
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 21:26 GMT-04:00 Matthias Troyer troyer@phys.ethz.ch:
Hi Leo,
The error messages indicate that you did not link against the MPI libraries.
Matthias
On 17 Jun 2015, at 17:45, Leo Fang leofang@phy.duke.edu wrote:
Hello all,
FYI, same error message can also be seen by compiling in the command line with g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Moreover, with g++ --version the information of my compiler is given below:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Any suggestion? Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 17:40 GMT-04:00 Leo Fang leofang@phy.duke.edu:
Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
Hello all,
I solved the problem by using a bit more sophisticated CMakeLists.txt, and all executables in the dmft folder, including hybridization, were successfully compiled in the command line.
A tip for Yosemite users (and also a suggestion for the next alps release): the vecLib framework, in which lapack is provided, has been deprecated and one should use the Accelerate framework instead (according to my search this deprecation happened way back to Snow Leopard). The best approach is to modify the file /opt/alps/share/alps/ALPSConfig.cmake and to replace every string "-framework vecLib" to "-framework Accelerate".
However, I still cannot build the project in Xcode (similar error). It would be nice if anyone who is experienced in coding an alps project in Xcode can give me a hand. Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 23:11 GMT-04:00 Leo Fang leofang@phy.duke.edu:
Dear Dr. Troyer,
I see, thanks. But it still doesn't answer my question that why the code cannot be compiled even with cmake.
I've tested the hello-world code from https://alps.comp-phys.org/svn/alps1/trunk/alps/tutorials/alpsize-01-cmake/, and the code can be successfully compiled by running cmake, changing "vecLib" to "Accelerate" as I explained in my previous email (some suggests that Yosemite is to be blamed for this; one can even replace -framework Accelerate simply by -llapack and it seems working), and finally running make. The same CMakeLists.txt file, however, cannot compile the hybridization code, and the error message was given in my previous email. Note that I do *not* link manually!
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 23:02 GMT-04:00 Matthias Troyer troyer@phys.ethz.ch:
When linking manually, as you seem to do, -L just gives the directory in which it should look for libraries, but does not specify the libraries that should be linked.
On Jun 17, 2015, at 19:32, Leo Fang leofang@phy.duke.edu wrote:
Hello Dr. Troyer,
Thank you very much for your reply. Forgive my stupidity, but aren't the paths to MPI headers and the MPI libraries already specified by the -I and -L flags? How come the MPI library is not linked?
I have examined the possibility that my compile command wasn't complete enough. Therefore, I tried following the instruction on the ALPS website ( http://alps.comp-phys.org/mediawiki/index.php/Tutorials:Using_ALPS_in_your_p...) to create a CMakeLists.txt file in which it pointed to hybmain.cpp. I put all source code and the txt file in the path ~/just_a_folder/, set $ALPS_HOME to /opt/alps, and ran cmake ~/just_a_folder/. It created a bunch of files in the same folder which I have not fully figured out what they represent yet, but I noticed there was a Makefile, so I further ran make. This time the error message was different:
Scanning dependencies of target hyb_test [ 50%] Building CXX object CMakeFiles/hyb_test.dir/hybmain.cpp.o [100%] Linking CXX executable hyb_test ld: framework not found vecLib clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
where the executable was named hyb_test. By looking at the file /opt/alps/share/alps/include.mk, I noticed that the flag vecLib represents lapack.
Google told me the vecLib framework is in /System/Library/Frameworks/vecLib.framework/, and I checked that it does exist. However, Google also told me that vecLib has been deprecated (see the Apple documentation here https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html#//apple_ref/doc/uid/TP40001067-CH210-BBCGHCCJ) and one should instead use the Accelerate framework. Therefore, having no way to get around, I decided to manually modify the file ~/just_a_folder/CMakeFiles/hyb_test.dir/link.txt and to use -framework Accelerate. Now I encounter the same problem with much fewer functions missing (for example, Alps, Boost and MPI are found):
[ 50%] Linking CXX executable hyb_test Undefined symbols for architecture x86_64: "evaluate_2p(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnt(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_nnw(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_freq(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_time(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_basics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_legendre(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "evaluate_sector_statistics(alps::mcresults const&, alps::params const&, alps::hdf5::archive&)", referenced from: master_final_tasks(alps::mcresults const&, alps::params const&, std::string const&) in hybmain.cpp.o "hybridization::update()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::measure()", referenced from: vtable for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "hybridization::hybridization(alps::params const&, int)", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::mcmpiadapter(alps::params const&, boost::mpi::communicator const&, alps::check_schedule const&) in hybmain.cpp.o "hybridization::fraction_completed() const", referenced from: alps::mcmpiadapter<hybridization, alps::check_schedule>::run(boost::function<bool ()> const&) in hybmain.cpp.o "typeinfo for hybridization", referenced from: typeinfo for alps::mcmpiadapter<hybridization, alps::check_schedule> in hybmain.cpp.o "vtable for hybridization", referenced from: hybridization::~hybridization() in hybmain.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [hyb_test] Error 1 make[1]: *** [CMakeFiles/hyb_test.dir/all] Error 2 make: *** [all] Error 2
These functions were already missing when I compiled with the simple command g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Now with the aid of cmake it seems less likely that a library is not linked. What can I do now?
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 21:26 GMT-04:00 Matthias Troyer troyer@phys.ethz.ch:
Hi Leo,
The error messages indicate that you did not link against the MPI libraries.
Matthias
On 17 Jun 2015, at 17:45, Leo Fang leofang@phy.duke.edu wrote:
Hello all,
FYI, same error message can also be seen by compiling in the command line with g++ -I/opt/alps/include -L/opt/alps/lib hybmain.cpp. Moreover, with g++ --version the information of my compiler is given below:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Any suggestion? Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-17 17:40 GMT-04:00 Leo Fang leofang@phy.duke.edu:
Hello all,
It's me again...I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3, and I've tested them.
Now I imported the source code of the "hybridization" application to Xcode as a stand-alone project and took care of the paths of included header files. However, when compiling almost finished, Xcode returned a bunch of "Apple Mach-O Linker Error", saying, for example,
Undefined symbols for architecture x86_64: "_MPI_Abort", referenced from: MPI::Comm::Abort(int) in hybevaluate.o MPI::Comm::Abort(int) in hybretintfun.o MPI::Comm::Abort(int) in hybint.o MPI::Comm::Abort(int) in hybmatrix_ft.o MPI::Comm::Abort(int) in hybupdates.o MPI::Comm::Abort(int) in hybmain.o MPI::Comm::Abort(int) in hybfun.o
and a lot of similar errors have to do with the MPI functions and other ALPS functions such as hdf5, ngs, etc. It seems the compiler can correctly find where the dylib files are, and so I am not sure what else can be wrong...I hope this question is less dumber than my previous one...
Thanks.
Sincerely, Leo (Fang Yao-Lung) Duke Physics
On Jun 19, 2015, at 6:36 PM, Leo Fang leofang@phy.duke.edu wrote:
A tip for Yosemite users (and also a suggestion for the next alps release): the vecLib framework, in which lapack is provided, has been deprecated and one should use the Accelerate framework instead (according to my search this deprecation happened way back to Snow Leopard). The best approach is to modify the file /opt/alps/share/alps/ALPSConfig.cmake and to replace every string "-framework vecLib" to "-framework Accelerate".
Can you confirm that you get this problem with the latest /trunk version? The issue seems to have been fixed 8 months ago.
Michele
-- ETH Zurich Michele Dolfi Institute for Theoretical Physics HIT G 32.4 Wolfgang-Pauli-Str. 27 8093 Zurich Switzerland
dolfim@phys.ethz.ch www.itp.phys.ethz.ch
+41 44 633 78 56 phone +41 44 633 11 15 fax
Hello Michele,
I have the binary packages of alps 2.2.0b3, vistrails 2.1.2 and alps-vistrails-2.2.0b3 installed on Mac OS X 10.10.3. Not sure this is relevant: my compiler version is "Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)".
Sincerely, Leo (Fang Yao-Lung) Duke Physics
2015-06-22 5:34 GMT-04:00 Michele Dolfi dolfim@phys.ethz.ch:
On Jun 19, 2015, at 6:36 PM, Leo Fang leofang@phy.duke.edu wrote:
A tip for Yosemite users (and also a suggestion for the next alps release): the vecLib framework, in which lapack is provided, has been deprecated and one should use the Accelerate framework instead (according to my search this deprecation happened way back to Snow Leopard). The best approach is to modify the file /opt/alps/share/alps/ALPSConfig.cmake and to replace every string "-framework vecLib" to "-framework Accelerate".
Can you confirm that you get this problem with the latest /trunk version? The issue seems to have been fixed 8 months ago.
Michele
-- ETH Zurich Michele Dolfi Institute for Theoretical Physics HIT G 32.4 Wolfgang-Pauli-Str. 27 8093 Zurich Switzerland
dolfim@phys.ethz.ch www.itp.phys.ethz.ch
+41 44 633 78 56 phone +41 44 633 11 15 fax
comp-phys-alps-users@lists.phys.ethz.ch