Am 10. Jul 2013, 21:50 schrieb David White <
david.w...@gmail.com>:
> Hi Matthias,
>
> I have a few more questions to ask that you may be able to help me
> with as well. Do you know of any successful installs of static deal.II
> on a CRAY machine?
I'm not aware of a successful installation of static deal.II on a CRAY
machine. But maybe Gudio, Timo or Wolfgang know better. :-D
> If not, what working installs are you aware of with
> static libraries, and perhaps you could show me some of the
> configuration necessary for those.
>
> I have read a little about using CMAKE instead of the configure
> script. Perhaps this would be a good alternative since we are using so
> many parameters that are not installed typically. Any opinion on this?
Well, as the one who has actually written the CMake stuff for deal.II my
opinion is a bit biased, isn't it? ;-)
Btw, do you only want to compile deal.II as a static library or is your
goal to compile a completely static executable (using a static deal.II
library)?
The former works quite well with the new CMake build system. It requires
some tweaking by hand, though. Have a look at a small test I just did [1].
For the latter, there is a last remaining issue to mitigate - namely -
CMake does search for shared libs prior to static libs.
I'll test a small patch that introduces a configuration toggle that will
- force CMake to only find static libs
- Build executables (when the cmake functionality provided by deal)
with -static.
- bail out if an external (static) library has a link interface with
dynamic libraries.
>
> I have tried compiling deal.II shared (along with all of the other
> libraries shared--LAPACK, BLACS, Trilinos, PETSc, etc), and I am
> encountering an error as follows:
>
>>=====deal.II==========optimized====== Linking library: libdeal_II.so
>> /usr/bin/ld:
> /home/sumuser1/EXTLIB/deal.II/deal.II/lib/contrib/umfpack/amd_i_control.o:
> relocation >R_X86_64_32 against `.rodata.str1.1' can not be used when
> making a shared object; recompile with >-fPIC
>>/home/sumuser1/EXTLIB/deal.II/deal.II/lib/contrib/umfpack/amd_i_control.o: could not read symbols: >Bad value
>>collect2: ld returned 1 exit status
>
> I have added -fPIC to the CFLAGS variables in AMD, UMFPACK and
> BLACS. I am worried that this is not the issue with the error. Perhaps
> you could guide me on how to edit those variables for compiling
> deal.II? Or perhaps that is the wrong direction to take for this
> error?
This is bundled AMD/UMFPACK, isn't it? The old build system should
already compile these object files with -fPIC (for later linkage to a
shared library.)
Have you changed any compile flags in the build system? Is this a
"vanilla" tarball?
Best,
Matthias
[1] A quick test with external, static openmpi, blas/lapack and petsc:
* Installed a static openmpi version:
./configure --disable-shared --enable-static --without-libnuma --without-memory-manager --prefix=$HOME/temp/test/openmpi-1.4.3-install
make
make install
* Installed PETSc with static blas/lapack and above openmpi:
PATH=$HOME/temp/test/openmpi-1.4.3-install/bin:$PATH PETSC_DIR=$PWD ./configure --download-f-blas-lapack
make PETSC_DIR=/home/tamiko/temp/test/petsc-3.3-p5 PETSC_ARCH=linux-gnu-cxx-opt all
* Configured and installed deal.II with the above libraries:
cmake -DBUILD_SHARED_LIBS=OFF \
-DDEAL_II_ALLOW_AUTODETECTION=OFF
-DDEAL_II_FORCE_BUNDLED_BOOST=ON \
-DWITH_THREADS=ON -DDEAL_II_FORCE_BUNDLED_THREADS=ON \
-DWITH_MPI=ON -DMPI_CXX_COMPILER=/home/tamiko/temp/test/openmpi-1.4.3-install/bin/mpicxx \
-DWITH_LAPACK=ON -DLAPACK_LIBRARIES="/home/tamiko/temp/test/petsc-3.3-p5/linux-gnu-cxx-opt/lib/libflapack.a;/home/tamiko/temp/test/petsc-3.3-p5/linux-gnu-cxx-opt/lib/libfblas.a;/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.3/libgfortran.a;/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.3/libquadmath.a;/usr/lib64/libm.a" \
-DWITH_PETSC=ON -DPETSC_DIR=/home/tamiko/temp/test/petsc-3.3-p5 -DPETSC_ARCH=linux-gnu-cxx-opt \
[...]
The resulting link interface (minus some very nasty dynamic linkage from
the link interface from PETSc... *sigh*):
tamiko@northernraven step-4 % ldd step-4
linux-vdso.so.1 (0x00007fffa2bff000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fdafcf76000)
libm.so.6 => /lib64/libm.so.6 (0x00007fdafcc80000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fdafca7c000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/libstdc++.so.6 (0x00007fdafc51c000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fdafc305000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdafc0e8000)
libc.so.6 => /lib64/libc.so.6 (0x00007fdafbd3f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdafd179000)
librt.so.1 => /lib64/librt.so.1 (0x00007fdafbb36000)