Error while linking libraries

189 views
Skip to first unread message

Moose User

unread,
Feb 11, 2015, 5:15:03 AM2/11/15
to moose...@googlegroups.com
Hello,

I tried to make MOOSE by changing into moose/test and doing 'make -j 4'. The compilation runs for a while until I get the following error:

Linking Library ~/Documents/01_project/Code/moose/framework/contrib/pcre/libpcre-opt.la...
~/Documents/01_project/Code/moose/framework/contrib/mtwist-1.1/src/randistrs.c:
~/Documents/01_project/Code/moose/framework/contrib/mtwist-1.1/src/mtwist.c:
Linking ~/Documents/01_project/Code/moose/framework/contrib/exodiff/exodiff...
ar
: ~/Documents/01_project/Code/moose/framework/contrib/pcre/src/pcre_dfa_exec.x86_64-unknown-linux-gnu.opt.o: No such file or directory
/usr/bin/ld:~/Documents/01_project/Code/moose/framework/contrib/exodiff/check.x86_64-unknown-linux-gnu.opt.o: file format not recognized; treating as linker script
/usr/bin/ld:~/Documents/01_project/Code/moose/framework/contrib/exodiff/check.x86_64-unknown-linux-gnu.opt.o:1: syntax error
make
: *** [~/Documents/01_project/Code/moose/framework/contrib/pcre/libpcre-opt.la] Error 1
make
: *** Waiting for unfinished jobs....
make
: *** [~/Documents/01_project/Code/moose/framework/contrib/exodiff/exodiff] Error 2

What am I missing? How can I compile MOOSE successfully?


Moose User

unread,
Feb 11, 2015, 5:16:45 AM2/11/15
to moose...@googlegroups.com
 PS: I am working with Ubuntu 14.04 and using Portland Compilers 15.1.

Cody Permann

unread,
Feb 11, 2015, 10:15:03 AM2/11/15
to moose...@googlegroups.com
We haven't built with the PGI compilers for a long time so it's possible there could be a few regressions. However, this error is most likely due to the fact that part of your software stack was compiled with GCC while the MOOSE was compiled with PGI. You'll need to rebuild the entire software stack with your compilers to ensure binary compatibility. If you want to go that route, you'll need to follow the instructions here modifying them as necessary for your compiler:

Unless you have a specific reason for using PGI, you'll receive better support if you stick with GCC or Clang.

Cody

On Wed Feb 11 2015 at 3:16:46 AM Moose User <b....@bluewin.ch> wrote:
 PS: I am working with Ubuntu 14.04 and using Portland Compilers 15.1.

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at http://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/347c38d1-fec1-4cf6-b345-527afc9ec21a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Moose User

unread,
Feb 11, 2015, 10:33:43 AM2/11/15
to moose...@googlegroups.com
Thank you for your reply.
The reason we are using PGI is that we work with a legacy code that we want to extend. If I cannot make MOOSE compile with PGI I guess eventually we will have to move to GCC or Clang.
Regarding the software stack:
I actually took very good care of setting up everything compatibly. After installing the PGI compilers, the first thing I did was building openMPI. This way I use the MPI commands as drivers to PGI compilers.
Following that I created install scripts for the following software packets: SLEPc, PETSc, Trilinos, HDF5 (which we are already using), VTK. In every shell script I set the environment variables CC, CXX, FC, etc. to the respective mpi wrappers.
After doing so, I run the update_and_rebuild_libmesh.sh script where I had to add the following options to configure: --disable-unordered-containers --disable-fparser-optimizer --enable-static --disable-shared. Additionally in libmesh/configure I have to change the flags '-fno-omit-frame-pointer' to the PGI-flag '-Mnoframe'. This way I can compile libMesh.
To compile MOOSE I had to change flags -MF to -MD inside framework/build.mk and remove flags -MF.

PGI specifies pgc++ as their C++ compiler for Linux since it is compatible with GNU libraries. Could that be the reason parts of the software stack were 'compiled with GCC'?

Sincerely

Cody Permann

unread,
Feb 11, 2015, 10:40:13 AM2/11/15
to moose...@googlegroups.com
On Wed Feb 11 2015 at 8:33:46 AM Moose User <b....@bluewin.ch> wrote:
Thank you for your reply.
The reason we are using PGI is that we work with a legacy code that we want to extend. If I cannot make MOOSE compile with PGI I guess eventually we will have to move to GCC or Clang.
Regarding the software stack:
I actually took very good care of setting up everything compatibly. After installing the PGI compilers, the first thing I did was building openMPI. This way I use the MPI commands as drivers to PGI compilers.
Following that I created install scripts for the following software packets: SLEPc, PETSc, Trilinos, HDF5 (which we are already using), VTK. In every shell script I set the environment variables CC, CXX, FC, etc. to the respective mpi wrappers.
After doing so, I run the update_and_rebuild_libmesh.sh script where I had to add the following options to configure: --disable-unordered-containers --disable-fparser-optimizer --enable-static --disable-shared. Additionally in libmesh/configure I have to change the flags '-fno-omit-frame-pointer' to the PGI-flag '-Mnoframe'. This way I can compile libMesh.
To compile MOOSE I had to change flags -MF to -MD inside framework/build.mk and remove flags -MF.

PGI specifies pgc++ as their C++ compiler for Linux since it is compatible with GNU libraries. Could that be the reason parts of the software stack were 'compiled with GCC'?

No, Sorry I assumed you started with our pre-compiled redistributable package. If you compiled everything from the ground up it should work once you have all of the switches and everything set up correctly. You might also verify that PETSc's and libMesh's tests both pass before digging further into MOOSE. Looking at your build error you're actually only having an issue in the linking stages, not the compiling stages. You'll need to dig into the linking command to see what's going wrong. I recommend that you run "make -n" after your compile fails so you can see the command that's failing. It says there's a file missing. Start there, is that file really missing? Is it having trouble with your path?

Cody
 

Sincerely





On Wednesday, February 11, 2015 at 4:15:03 PM UTC+1, Cody Permann wrote:
We haven't built with the PGI compilers for a long time so it's possible there could be a few regressions. However, this error is most likely due to the fact that part of your software stack was compiled with GCC while the MOOSE was compiled with PGI. You'll need to rebuild the entire software stack with your compilers to ensure binary compatibility. If you want to go that route, you'll need to follow the instructions here modifying them as necessary for your compiler:

Unless you have a specific reason for using PGI, you'll receive better support if you stick with GCC or Clang.

Cody

On Wed Feb 11 2015 at 3:16:46 AM Moose User <b....@bluewin.ch> wrote:
 PS: I am working with Ubuntu 14.04 and using Portland Compilers 15.1.

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at http://groups.google.com/group/moose-users.

Peterson, JW

unread,
Feb 11, 2015, 11:31:12 AM2/11/15
to moose-users
On Wed Feb 11 2015 at 8:33:46 AM Moose User <b....@bluewin.ch> wrote:

ar: ~/Documents/01_project/Code/moose/framework/contrib/pcre/src/pcre_dfa_exec.x86_64-unknown-linux-gnu.opt.o: No such file or directory
/usr/bin/ld:~/Documents/01_project/Code/moose/framework/contrib/exodiff/check.x86_64-unknown-linux-gnu.opt.o: file format not recognized; treating as linker script
/usr/bin/ld:~/Documents/01_project/Code/moose/framework/contrib/exodiff/check.x86_64-unknown-linux-gnu.opt.o:1: syntax error
make
make: *** [~/Documents/01_project/Code/moose/framework/contrib/pcre/libpcre-opt.la] Error 1
make: *** Waiting for unfinished jobs....
make: *** [~/Documents/01_project/Code/moose/framework/contrib/exodiff/exodiff] Error 2

 
To compile MOOSE I had to change flags -MF to -MD inside framework/build.mk and remove flags -MF.


It looks like the PCRE library failed to build at all (the object files MOOSE expects to link against do not even exist).  This could be due to removing -MF from the Makefiles, but I am not sure as I have never tried to compile this way... I would consider lack of support for -MF to be a fairly serious issue for using the PGI compilers going forward...
 

 
Regarding the software stack:
I actually took very good care of setting up everything compatibly. After installing the PGI compilers, the first thing I did was building openMPI. This way I use the MPI commands as drivers to PGI compilers. 
Following that I created install scripts for the following software packets: SLEPc, PETSc, Trilinos, HDF5 (which we are already using), VTK. In every shell script I set the environment variables CC, CXX, FC, etc. to the respective mpi wrappers.
After doing so, I run the update_and_rebuild_libmesh.sh script where I had to add the following options to configure: --disable-unordered-containers --disable-fparser-optimizer --enable-static --disable-shared. Additionally in libmesh/configure I have to change the flags '-fno-omit-frame-pointer' to the PGI-flag '-Mnoframe'. This way I can compile libMesh.

I am a bit surprised by this, as we have definitely had issues compiling libmesh with PGI compilers in the past.  What version of PGI are you using?  Can you try running "make check" in $MOOSE_DIR/libmesh/build?


--
John

Moose User

unread,
Feb 11, 2015, 11:39:24 AM2/11/15
to moose...@googlegroups.com
Hello, thank you for your advice.
I am sorry  that what a typo of mine.
I actually replace -MF by -MD (which should be equivalent for writing dependency file with PGI). The flags that are not supported and that I removed where -MP.

I now realized that when running 'make check' in libmesh/build I get the following errors:

make[3]: `example-dbg' is up to date.
make[3]: `example-opt' is up to date.
  CXXLD    example-oprof
../../../.libs/libmesh_oprof.a(libmesh_oprof_la-tree_node.o): In function `.st50665':
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x0): undefined reference to `.LB14852'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x8): undefined reference to `.LB14853'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x10): undefined reference to `.LB14854'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x18): undefined reference to `.LB14855'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x20): undefined reference to `.LB14856'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x28): undefined reference to `.LB14857'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x30): undefined reference to `.LB14858'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj2EE19create_bounding_boxEj]+0x38): undefined reference to `.LB14859'
../../../.libs/libmesh_oprof.a(libmesh_oprof_la-tree_node.o): In function `.st55932':
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x0): undefined reference to `.LB15654'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x8): undefined reference to `.LB15655'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x10): undefined reference to `.LB15656'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x18): undefined reference to `.LB15657'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x20): undefined reference to `.LB15658'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x28): undefined reference to `.LB15659'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x30): undefined reference to `.LB15660'
tree_node.C:(.gnu.linkonce.r._ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj[_ZNK7libMesh8TreeNodeILj4EE19create_bounding_boxEj]+0x38): undefined reference to `.LB15661'
make[3]: *** [example-oprof] Error 2


Sincerely

Moose User

unread,
Feb 11, 2015, 1:02:38 PM2/11/15
to moose...@googlegroups.com
The PGI version I stated above is 15.1


On Wednesday, February 11, 2015 at 5:31:12 PM UTC+1, jw.peterson wrote:

Moose User

unread,
Feb 11, 2015, 1:03:00 PM2/11/15
to moose...@googlegroups.com
So the files are present. I do not know why it does not find the file pcre_dfa_exec.x86_64-unknown-linux-gnu.opt.o


Cody Permann

unread,
Feb 11, 2015, 2:31:19 PM2/11/15
to moose...@googlegroups.com
You need to make sure that libMesh is working before you troubleshoot MOOSE. Again, PGI support is limited in both of these packages. Historically it hasn't been the most robust C++ compiler.

Reply all
Reply to author
Forward
0 new messages