MOAB error: Undefined symbols for architecture x86_64
Hi, I tried a few MOAB examples, and got compile errors like below. I am using OS X Yosemite 10.10.3. Can anybody suggest a solution? Thanks. [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0 CPPFLAGS=-I/Users/xuwu/software/sharp_deps/moab-4.8.0/include/ mpicxx -I/Users/xuwu/software/sharp_deps/moab-4.8.0/include/ HelloMOAB.cpp -o HelloMOAB Undefined symbols for architecture x86_64: "moab::Core::Core()", referenced from: _main in ccfOALBp.o "moab::Range::clear()", referenced from: moab::Range::~Range() in ccfOALBp.o "moab::MBError(int, char const*, char const*, char const*, moab::ErrorCode, char const*, moab::ErrorType)", referenced from: _main in ccfOALBp.o "moab::Range::size() const", referenced from: _main in ccfOALBp.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make: *** [HelloMOAB] Error 1 -Xu
use the makefile generated by configure in the examples folder it has all the required definitions, link libraries, etc just type make HelloMOAB and you should be fine you are missing from your link line the moab library. Iulian ________________________________ From: [email protected] [[email protected]] on behalf of Wu, Xu [[email protected]] Sent: Monday, July 06, 2015 8:11 AM To: [email protected] Subject: [MOAB-dev] MOAB error: Undefined symbols for architecture x86_64 Hi, I tried a few MOAB examples, and got compile errors like below. I am using OS X Yosemite 10.10.3. Can anybody suggest a solution? Thanks. [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0 CPPFLAGS=-I/Users/xuwu/software/sharp_deps/moab-4.8.0/include/ mpicxx -I/Users/xuwu/software/sharp_deps/moab-4.8.0/include/ HelloMOAB.cpp -o HelloMOAB Undefined symbols for architecture x86_64: "moab::Core::Core()", referenced from: _main in ccfOALBp.o "moab::Range::clear()", referenced from: moab::Range::~Range() in ccfOALBp.o "moab::MBError(int, char const*, char const*, char const*, moab::ErrorCode, char const*, moab::ErrorType)", referenced from: _main in ccfOALBp.o "moab::Range::size() const", referenced from: _main in ccfOALBp.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make: *** [HelloMOAB] Error 1 -Xu
Thanks Iulian, I tried that before, but the headers files can not be found. And I do have MOAB_DIR as my environment variable. I attached the makefile.in in the examples folder. Thanks, -Xu [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB mpicxx HelloMOAB.cpp -o HelloMOAB HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory #include "moab/Core.hpp" ^ compilation terminated. make: *** [HelloMOAB] Error 1 [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0 mpicxx HelloMOAB.cpp -o HelloMOAB HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory #include "moab/Core.hpp" ^ compilation terminated. make: *** [HelloMOAB] Error 1 [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> echo $MOAB_DIR /Users/xuwu/software/sharp_deps/moab-4.8.0 From: "Grindeanu, Iulian R." <[email protected]<mailto:[email protected]>> Date: Monday, July 6, 2015 at 8:36 AM To: Xu Wu <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: RE: MOAB error: Undefined symbols for architecture x86_64 make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
makefile.in is in the source folder; where is your build folder, that one has a makefile generated from this one; which you can use to build any example ________________________________ From: Wu, Xu Sent: Monday, July 06, 2015 8:48 AM To: Grindeanu, Iulian R.; [email protected] Subject: Re: MOAB error: Undefined symbols for architecture x86_64 Thanks Iulian, I tried that before, but the headers files can not be found. And I do have MOAB_DIR as my environment variable. I attached the makefile.in in the examples folder. Thanks, -Xu [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB mpicxx HelloMOAB.cpp -o HelloMOAB HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory #include "moab/Core.hpp" ^ compilation terminated. make: *** [HelloMOAB] Error 1 [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0 mpicxx HelloMOAB.cpp -o HelloMOAB HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory #include "moab/Core.hpp" ^ compilation terminated. make: *** [HelloMOAB] Error 1 [xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> echo $MOAB_DIR /Users/xuwu/software/sharp_deps/moab-4.8.0 From: "Grindeanu, Iulian R." <[email protected]<mailto:[email protected]>> Date: Monday, July 6, 2015 at 8:36 AM To: Xu Wu <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: RE: MOAB error: Undefined symbols for architecture x86_64 make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
MOAB_DIR is the installation directory and not the source directory. That is why it is important to pick up the makefile from your installed directory. This can be used to compile/link any sources in MOAB examples folder or your own custom folder since necessary flags will always be resolved. 1) Copy MOAB_INSTALL_DIR/examples/makefile to your examples directory 2) Do make HelloMOAB If this fails, send us your makefile, MOAB source directory location, MOAB installation directory location along with configure command. Vijay On Mon, Jul 6, 2015 at 3:48 PM, Wu, Xu <[email protected]> wrote:
Thanks Iulian,
I tried that before, but the headers files can not be found. And I do have MOAB_DIR as my environment variable. I attached the makefile.in in the examples folder. Thanks,
-Xu
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB
mpicxx HelloMOAB.cpp -o HelloMOAB
HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory
#include "moab/Core.hpp"
^
compilation terminated.
make: *** [HelloMOAB] Error 1
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
mpicxx HelloMOAB.cpp -o HelloMOAB
HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory
#include "moab/Core.hpp"
^
compilation terminated.
make: *** [HelloMOAB] Error 1
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> echo $MOAB_DIR
/Users/xuwu/software/sharp_deps/moab-4.8.0
From: "Grindeanu, Iulian R." <[email protected]> Date: Monday, July 6, 2015 at 8:36 AM To: Xu Wu <[email protected]>, "[email protected]" <[email protected]> Subject: RE: MOAB error: Undefined symbols for architecture x86_64
make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
Hi Vijay and Iulian, As I understand: MOAB source directory is the one in which I ran the ³configure² command. For me it is ³/Users/xuwu/Downloads/SHARP/moab-4.8.1/³. MOAB installation directory is the destination of ³‹prefix=³ in the configuration. For me it is ³/Users/xuwu/software/sharp_deps/moab-4.8.1². I removed the source directory after installation, that¹s why I could not find the makefile. I installed MOAB again, and I found a makefile generated in ³/Users/xuwu/Downloads/SHARP/moab-4.8.1/examples², I copied it to ³/Users/xuwu/software/sharp_deps/moab-4.8.1/share/examples², and I can compile the examples now. Thanks for the help. -Xu On 7/6/15, 8:58 AM, "Vijay S. Mahadevan" <[email protected]> wrote:
MOAB_DIR is the installation directory and not the source directory. That is why it is important to pick up the makefile from your installed directory. This can be used to compile/link any sources in MOAB examples folder or your own custom folder since necessary flags will always be resolved.
1) Copy MOAB_INSTALL_DIR/examples/makefile to your examples directory 2) Do make HelloMOAB
If this fails, send us your makefile, MOAB source directory location, MOAB installation directory location along with configure command.
Vijay
On Mon, Jul 6, 2015 at 3:48 PM, Wu, Xu <[email protected]> wrote:
Thanks Iulian,
I tried that before, but the headers files can not be found. And I do have MOAB_DIR as my environment variable. I attached the makefile.in in the examples folder. Thanks,
-Xu
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB
mpicxx HelloMOAB.cpp -o HelloMOAB
HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory
#include "moab/Core.hpp"
^
compilation terminated.
make: *** [HelloMOAB] Error 1
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
mpicxx HelloMOAB.cpp -o HelloMOAB
HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory
#include "moab/Core.hpp"
^
compilation terminated.
make: *** [HelloMOAB] Error 1
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> echo $MOAB_DIR
/Users/xuwu/software/sharp_deps/moab-4.8.0
From: "Grindeanu, Iulian R." <[email protected]> Date: Monday, July 6, 2015 at 8:36 AM To: Xu Wu <[email protected]>, "[email protected]" <[email protected]> Subject: RE: MOAB error: Undefined symbols for architecture x86_64
make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
Yes, this was an inconsistent behavior and thanks for pointing it out. We have a branch now that will fix this and makefile will be installed along with examples in the future to avoid confusion and to make the installation self sufficient. Vijay On Mon, Jul 6, 2015 at 9:42 AM, Wu, Xu <[email protected]> wrote:
Hi Vijay and Iulian,
As I understand: MOAB source directory is the one in which I ran the ³configure² command. For me it is ³/Users/xuwu/Downloads/SHARP/moab-4.8.1/³. MOAB installation directory is the destination of ³‹prefix=³ in the configuration. For me it is ³/Users/xuwu/software/sharp_deps/moab-4.8.1².
I removed the source directory after installation, that¹s why I could not find the makefile.
I installed MOAB again, and I found a makefile generated in ³/Users/xuwu/Downloads/SHARP/moab-4.8.1/examples², I copied it to ³/Users/xuwu/software/sharp_deps/moab-4.8.1/share/examples², and I can compile the examples now.
Thanks for the help.
-Xu
On 7/6/15, 8:58 AM, "Vijay S. Mahadevan" <[email protected]> wrote:
MOAB_DIR is the installation directory and not the source directory. That is why it is important to pick up the makefile from your installed directory. This can be used to compile/link any sources in MOAB examples folder or your own custom folder since necessary flags will always be resolved.
1) Copy MOAB_INSTALL_DIR/examples/makefile to your examples directory 2) Do make HelloMOAB
If this fails, send us your makefile, MOAB source directory location, MOAB installation directory location along with configure command.
Vijay
On Mon, Jul 6, 2015 at 3:48 PM, Wu, Xu <[email protected]> wrote:
Thanks Iulian,
I tried that before, but the headers files can not be found. And I do have MOAB_DIR as my environment variable. I attached the makefile.in in the examples folder. Thanks,
-Xu
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB
mpicxx HelloMOAB.cpp -o HelloMOAB
HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory
#include "moab/Core.hpp"
^
compilation terminated.
make: *** [HelloMOAB] Error 1
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
mpicxx HelloMOAB.cpp -o HelloMOAB
HelloMOAB.cpp:10:25: fatal error: moab/Core.hpp: No such file or directory
#include "moab/Core.hpp"
^
compilation terminated.
make: *** [HelloMOAB] Error 1
[xuwu][~/software/sharp_deps/moab-4.8.0/share/examples]> echo $MOAB_DIR
/Users/xuwu/software/sharp_deps/moab-4.8.0
From: "Grindeanu, Iulian R." <[email protected]> Date: Monday, July 6, 2015 at 8:36 AM To: Xu Wu <[email protected]>, "[email protected]" <[email protected]> Subject: RE: MOAB error: Undefined symbols for architecture x86_64
make HelloMOAB MOAB_DIR=/Users/xuwu/software/sharp_deps/moab-4.8.0
participants (3)
-
Grindeanu, Iulian R. -
Vijay S. Mahadevan -
Wu, Xu