Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple bugs in building and shared library not being generated #45

Open
avarpow opened this issue May 1, 2022 · 4 comments
Open

multiple bugs in building and shared library not being generated #45

avarpow opened this issue May 1, 2022 · 4 comments

Comments

@avarpow
Copy link

avarpow commented May 1, 2022

my env:

$spack find --loaded
==> 14 loaded packages
-- linux-centos7-skylake_avx512 / gcc@8.3.0 ---------------------
autoconf@2.69    berkeley-db@18.1.40  gdbm@1.19        libtool@2.4.6  ncurses@6.2  readline@8.1
automake@1.16.3  bzip2@1.0.8          libsigsegv@2.13  m4@1.4.19      perl@5.34.0  zlib@1.2.11

-- linux-centos7-skylake_avx512 / gcc@9.3.0 ---------------------
openmpi@4.1.1  papi@6.0.0.1

 $module list

Currently Loaded Modules:
  1) NiaEnv/2019b   2) gcc/8.3.0

configure:

./configure --enable-shared  --enable-parser --enable-posixio --with-papi=/xxxxxxxxxxxxxx/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.3.0/papi-6.0.0.1-btlnyicokbpyo222py5daqsw5kwvmjrs LDFLAGS=-L/xxxxxxxxxxxxxxx/mxml CFLAGS=-fPIC CPPFLAGS=-I/xxxxxxxxxxxxxx/mxml FC=gfortran

1.The generated file src/Makefile FC = is empty,I add it manually.
2.Commands in src/Makefile target libipm.la and libipmf.la shoud change from rpath to -Wl,rpath=
Then it can be compiled and libipm.a and libipmf.a generated in src/.libs. but libipm.so and libipmf.so not be generated.

I compile libipm.so and libipmf.so manually using the following command.
libipm.so

mpicc -shared  -DPIC  .libs/libipm_la-calltable.o .libs/libipm_la-hashkey.o .libs/libipm_la-hashtable.o .libs/libipm_la-ipm_core.o .libs/libipm_la-ipm_env.o .libs/libipm_la-ipm_time.o .libs/libipm_la-ipm_modules.o .libs/libipm_la-jobdata.o .libs/libipm_la-md5.o .libs/libipm_la-memusage.o .libs/libipm_la-perfdata.o .libs/libipm_la-regstack.o .libs/libipm_la-report.o .libs/libipm_la-report_banner.o .libs/libipm_la-report_xml.o .libs/libipm_la-ipm_introspect.o .libs/libipm_la-mod_mpi.o .libs/libipm_la-mpi_init.o .libs/libipm_la-mpi_finalize.o .libs/libipm_la-mpi_pcontrol.o .libs/libipm_la-machtopo.o .libs/libipm_la-mod_posixio.o .libs/libipm_la-mod_papi.o .libs/libipm_la-GEN.wrapper_mpi.o .libs/libipm_la-GEN.calltable_mpi.o .libs/libipm_la-GEN.wrapper_posixio.o .libs/libipm_la-GEN.fake_posixio.o .libs/libipm_la-GEN.calltable_posixio.o   -L/xxxxxxxxxxxxx/mxml -L/xxxxxxxxxxxxx/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.3.0/papi-6.0.0.1-btlnyicokbpyo222py5daqsw5kwvmjrs/lib -lmxml -lpapi -lc  -Wl,-rpath=/xxxxxxxxxxxxx/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.3.0/papi-6.0.0.1-btlnyicokbpyo222py5daqsw5kwvmjrs/lib   -Wl,-soname=libipm.so.0 -o .libs/libipm.so.0.0.0

libipmf.so

mpifort -shared  -DPIC .libs/libipmf_la-mpi_fortran.o .libs/libipmf_la-GEN.wrapper_mpif.o -L/scratch/l/lcl_uotiscscc/lcl_uotiscsccs1035/mxml -L/xxxxxxxxxxxxxxx/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.3.0/papi-6.0.0.1-btlnyicokbpyo222py5daqsw5kwvmjrs/lib -lmxml -lpapi -lc  -Wl,-rpath=/xxxxxxxxxxxxxxxxxx/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.3.0/papi-6.0.0.1-btlnyicokbpyo222py5daqsw5kwvmjrs/lib   -Wl,-soname=libipmf.so.0 -o .libs/libipmf.so.0.0.0

I test with my openmpi@4.1.1 and it works well.

Is there any way to correct the configure script to fix the wrong makefile?
Why shared library not being generated?

@robinren03
Copy link

Hi, I have the same issue with you. But as I compiled without posix and papi. It becomes a little more difficult for me to build the *.so files as it comes out the following outputs

/usr/bin/ld: .libs/libipm_la-GEN.wrapper_mpi.o: warning: relocation against ompi_mpi_comm_world' in read-only section .text'
/usr/bin/ld: .libs/libipm_la-calltable.o: relocation R_X86_64_PC32 against symbol `ipm_calltable' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value

Do you have any idea how to fix it?

@avarpow
Copy link
Author

avarpow commented Oct 15, 2022

never seen before. whats ur env?maybe mpi version different

@robinren03
Copy link

An openmpi@4.0.5 built with spack and ucx. I don't think that makes a big difference though

@sumuzhe317
Copy link

I install openmpi and ucx using spack, and then I install IPM using spack also. I find that the IPM could work well when I use mpicc to compile C code and generate output. But when it comes to fortran code, it's different. I compile fortran code with options '-lipm -lipmf', and use ldd to check. However, it didn't generate the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants