opencollab / arpack-ng

Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems.
Other
289 stars 124 forks source link

[regression] 3.7.0: build breaks on FreeBSD: eval: 1: Syntax error: "(" unexpected #204

Closed yurivict closed 4 years ago

yurivict commented 5 years ago
--- stat_icb.lo ---
libtool: compile:  mpif90 -DPACKAGE_NAME=\"ARPACK-NG\" -DPACKAGE_TARNAME=\"arpack-ng\" -DPACKAGE_VERSION=\"3.7.0\" "-DPACKAGE_STRING=\"ARPACK-NG 3.7.0\"" -DPACKAGE_BUGREPORT=\"https://github.com/opencollab/arpack-ng/issues/\" -DPACKAGE_URL=\"https://github.com/opencollab/arpack-ng/\" -DPACKAGE=\"arpack-ng\" -DVERSION=\"3.7.0\" -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_MPI=1 -DHAVE_MPI=1 "-DFC_FUNC(name,NAME)=name ## _" "-DFC_FUNC_(name,NAME)=name ## _" -DHAVE_MPI=1 -DHAVE_MPI=1 -DHAVE_CXX11=1 -I. -I.. -I.. -fno-omit-frame-pointer -Wl,-rpath=/usr/local/lib/gcc8 -c stat_icb.F90  -fPIC -o .libs/stat_icb.o
--- debug_icb.lo ---
eval: 1: Syntax error: "(" unexpected
--- stat_icb.lo ---
eval: 1: Syntax error: "(" unexpected
*** [stat_icb.lo] Error code 1

make[3]: stopped in /usr/ports/math/arpack-ng/work/arpack-ng-3.7.0/ICB
--- debug_icb.lo ---
*** [debug_icb.lo] Error code 1

Found while trying to update the FreeBSD port. Version 3.6.3 is building fine.

fghoussen commented 5 years ago

No idea. Any previous error / msg ? Or try to add BSD build on ci via Docker ?

yurivict commented 5 years ago

No previous messages. Are there any /bin/sh commands ran during build that use bash syntax?

fghoussen commented 5 years ago

Would say no. Try to add and PR a BSD build via Docker following #199: would make pb visible to everybody !

fghoussen commented 5 years ago

On debian/testing :

sudo docker search bsd
...
lexaguskov/bsd
...

So you can likely redo what has been done in the .travis.yml file from #199 but replacing fedora with lexaguskov/bsd, and then, in the script associated to docker-create, you can call all cmd lines necessary on bsd (never used - don't know anything about it !) to install dependencies and build/test arpack-ng. And PR it ?!

Hope this helps !...

fghoussen commented 5 years ago

@yurivict : did you update also libtool ?

yurivict commented 5 years ago

@fghoussen I have libtool-2.4.6_1 installed.

fghoussen commented 5 years ago

@yurivict : seems recent enough, but, try to update autoconf, automake, libtool and retry from scratch.

yurivict commented 5 years ago

I updated autoconf, automake, libtool, but the problem is still there.

It definitely calls /bin/sh with bash syntax somewhere.

I'll try the cmake build instead.

fghoussen commented 5 years ago

I updated autoconf, automake, libtool, but the problem is still there.

At my side on debian/testing:

>> dpkg -l autoconf automake libtool
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=====================================================
ii  autoconf       2.69-11      all          automatic configure script builder
ii  automake       1:1.16.1-4   all          Tool for generating GNU Standards-compliant Makefiles
ii  libtool        2.4.6-9      all          Generic library support script
yurivict commented 5 years ago
$ pkg info autoconf automake libtool
autoconf-2.69_2
automake-1.16.1_1
libtool-2.4.6_1
fghoussen commented 5 years ago

It definitely calls /bin/sh with bash syntax somewhere.

on master:

>> git grep bash
.travis.yml:      sudo docker create --name mobydick debian /bin/bash -c                                                            
EXAMPLES/MATRIX_MARKET/arpackmm.sh:#!/bin/bash -eu

The only reference to bash seems to be a shebang added (between 3.6.3 and master) in a ̀.sh` script added for testing purpose.... Can you checkout at 8840cfdf43b5 (= just before creation of this script) and see if build systems (autotools/cmake) are still crazy ?

I couldn't understand a shebang added in a script could blow up everything ?!...

yurivict commented 5 years ago

On linux they typically assume that /bin/sh is bash, while on BSD they are different. The correct way to handle this is to pass shell through the configure argument. CONFIG_SHELL environment variable is supposed to be used for this.

fghoussen commented 5 years ago

Does this make a difference ?

>> git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1af53ce..7f5e512 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -563,7 +563,7 @@ if(ICB)
     configure_file(EXAMPLES/MATRIX_MARKET/B.mtx  ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/B.mtx)
     configure_file(EXAMPLES/MATRIX_MARKET/Bz.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Bz.mtx)
     configure_file(EXAMPLES/MATRIX_MARKET/arpackmm.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/arpackmm.sh)
-    add_test(NAME arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND arpackmm.sh)
+    add_test(NAME arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND bash arpackmm.sh)
   endif()

   if (MPI)
diff --git a/EXAMPLES/MATRIX_MARKET/Makefile.am b/EXAMPLES/MATRIX_MARKET/Makefile.am
index 0609033..4813ece 100644
--- a/EXAMPLES/MATRIX_MARKET/Makefile.am
+++ b/EXAMPLES/MATRIX_MARKET/Makefile.am
@@ -6,6 +6,7 @@ EXTRA_DIST = README
 check_PROGRAMS = arpackmm
 dist_check_SCRIPTS = arpackmm.sh
 dist_check_DATA = An.mtx As.mtx Az.mtx B.mtx Bz.mtx
+TESTS_ENVIRONMENT = bash
 TESTS = arpackmm.sh

 arpackmm_SOURCES = arpackmm.cpp
yurivict commented 5 years ago

8840cfd builds w/out a problem.

yurivict commented 5 years ago

This change

 dist_check_DATA = An.mtx As.mtx Az.mtx B.mtx Bz.mtx
+TESTS_ENVIRONMENT = bash
 TESTS = arpackmm.sh

didn't make a difference. cmake isn't used, so the other change isn't applicable.

fghoussen commented 5 years ago

8840cfd builds w/out a problem.

Good news ! :D

Does the patch above make a difference back on master ?

yurivict commented 5 years ago

Does the patch above make a difference back on master ?

Not with 3.7.0

fghoussen commented 5 years ago

OK, so the pb is localized, but, not sure how to fix this...

fghoussen commented 5 years ago

I guess you tried CONFIG_SHELL=/bin/bash ./configure ... on master without success ?

yurivict commented 5 years ago

I use CONFIG_SHELL=/usr/local/bin/bash, and SHELL=/usr/local/bin/bash

fghoussen commented 5 years ago

Does this make a difference ?

>> git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1af53ce..ddbff5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,7 @@ if (ICBEXMM)
         find_package(PkgConfig 3.2 REQUIRED)
         pkg_check_modules(EIGEN3 REQUIRED eigen3>=3.2)
     endif ()
+    find_program (BASH_PROGRAM bash)

     # Look for headers.
     find_path(EIGEN3_SPARSE_DIR NAMES Sparse PATHS ${EIGEN3_INCLUDE_DIRS} PATH_SUFFIXES Eigen)
@@ -563,7 +564,7 @@ if(ICB)
     configure_file(EXAMPLES/MATRIX_MARKET/B.mtx  ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/B.mtx)
     configure_file(EXAMPLES/MATRIX_MARKET/Bz.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Bz.mtx)
     configure_file(EXAMPLES/MATRIX_MARKET/arpackmm.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/arpackmm.sh)
-    add_test(NAME arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND arpackmm.sh)
+    add_test(NAME arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND  ${BASH_PROGRAM} arpackmm.sh)
   endif()

   if (MPI)
diff --git a/EXAMPLES/MATRIX_MARKET/Makefile.am b/EXAMPLES/MATRIX_MARKET/Makefile.am
index 0609033..f9ecde7 100644
--- a/EXAMPLES/MATRIX_MARKET/Makefile.am
+++ b/EXAMPLES/MATRIX_MARKET/Makefile.am
@@ -6,6 +6,7 @@ EXTRA_DIST = README
 check_PROGRAMS = arpackmm
 dist_check_SCRIPTS = arpackmm.sh
 dist_check_DATA = An.mtx As.mtx Az.mtx B.mtx Bz.mtx
+SH_LOG_COMPILER = bash
 TESTS = arpackmm.sh

 arpackmm_SOURCES = arpackmm.cpp
yurivict commented 5 years ago

No difference.

You change under EXAMPLES, but it breaks in ICB/debug_icb.F90.

EXAMPLES shouldn't be built in the port at all.

yurivict commented 5 years ago

IMO, you should better fix the cmake build so that it would be able to produce the same result as GNU tools. cmake is a much nicer and more scaleable technology, in general.

fghoussen commented 5 years ago

AFK. No idea. If you find a fix, PR it.

fghoussen commented 5 years ago

Back to keyboard. From here, looks like different problems (compiler + bash ?) are mixed.

Q1: what's your compiler ? Try updated version ? try "safer" version (say prefer gcc-8.x to newer gcc-9) ? Try another compiler ? (clang ?)

On debian/testing I have:

>> dpkg -l gcc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  gcc            4:8.2.0-2    amd64        GNU C compiler

Q2: you said 8840cfd is building/testing OK.

Now checkout to the commit after (2c1f6ebb5b), and, "shadow" the build and test of the arpackmm example : should be OK. Is it ?

>> git diff
diff --git a/EXAMPLES/Makefile.am b/EXAMPLES/Makefile.am
index eef706a..9efc04d 100644
--- a/EXAMPLES/Makefile.am
+++ b/EXAMPLES/Makefile.am
@@ -1,6 +1,3 @@
 SUBDIRS = BAND COMPLEX NONSYM SIMPLE SVD SYM
-if ICBEXMM
-SUBDIRS += MATRIX_MARKET
-endif

 EXTRA_DIST = README README.CALLING-ARPACK-FROM-C-OR-CPP

Q3 : Now roll back the previous modif, stick checkout'ed to 2c1f6ebb5b, but now allow build but shadow the test of the arpackmm example : build should be OK. If not you may have a compiler problem

>> git diff
diff --git a/EXAMPLES/MATRIX_MARKET/Makefile.am b/EXAMPLES/MATRIX_MARKET/Makefile.am
index 0609033..0091150 100644
--- a/EXAMPLES/MATRIX_MARKET/Makefile.am
+++ b/EXAMPLES/MATRIX_MARKET/Makefile.am
@@ -4,9 +4,6 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/ICB $(EIGEN3_CFLAGS)
 EXTRA_DIST = README

 check_PROGRAMS = arpackmm
-dist_check_SCRIPTS = arpackmm.sh
-dist_check_DATA = An.mtx As.mtx Az.mtx B.mtx Bz.mtx
-TESTS = arpackmm.sh

 arpackmm_SOURCES = arpackmm.cpp

Q4: now say you have build all successfully, you may have a problem during make check/test because of the "bash problem" : #206 should fix it. Does it ?

Q5: what are your configure options ? arpackmm is built/tested only if --enable-icb-exmm or -DICBEXMM=ON is set. These options are not used by default: you may not want/need to set them.

should better fix the cmake build

Don't get what you mean... All tests are built and ran if you run make check/test no way to "fix" that ? no way to get that "out of the port" ? All tests do build exe they need : for arpackmm, the only difference is that you need a (bash) script to run the same exe several times with different arguments

kc9jud commented 5 years ago

Related problem, Ubuntu 18.04:

make[1]: Entering directory '/home/pjfasano/Research/code/arpack-ng'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/pjfasano/Research/code/arpack-ng'
Making all in ICB
make[1]: Entering directory '/home/pjfasano/Research/code/arpack-ng/ICB'
/bin/bash ../libtool  --tag=FC   --mode=compile mpiifort -DPACKAGE_NAME=\"ARPACK-NG\" -DPACKAGE_TARNAME=\"arpack-ng\" -DPACKAGE_VERSION=\"3.7.0\" -DPACKAGE_STRING=\"ARPACK-NG\ 3.7.0\" -DPACKAGE_BUGREPORT=\"https://github.com/opencollab/arpack-ng/issues/\" -DPACKAGE_URL=\"https://github.com/opencollab/arpack-ng/\" -DPACKAGE=\"arpack-ng\" -DVERSION=\"3.7.0\" -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_MPI=1 -DHAVE_MPI=1 -DFC_FUNC\(name,NAME\)=name\ ##\ _ -DFC_FUNC_\(name,NAME\)=name\ ##\ _ -DHAVE_MPI=1 -DHAVE_MPI=1 -DHAVE_CXX11=1 -I.  -I.. -I..   -g -c -o debug_icb.lo debug_icb.F90
libtool: compile:  mpiifort -DPACKAGE_NAME=\"ARPACK-NG\" -DPACKAGE_TARNAME=\"arpack-ng\" -DPACKAGE_VERSION=\"3.7.0\" "-DPACKAGE_STRING=\"ARPACK-NG 3.7.0\"" -DPACKAGE_BUGREPORT=\"https://github.com/opencollab/arpack-ng/issues/\" -DPACKAGE_URL=\"https://github.com/opencollab/arpack-ng/\" -DPACKAGE=\"arpack-ng\" -DVERSION=\"3.7.0\" -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_MPI=1 -DHAVE_MPI=1 "-DFC_FUNC(name,NAME)=name ## _" "-DFC_FUNC_(name,NAME)=name ## _" -DHAVE_MPI=1 -DHAVE_MPI=1 -DHAVE_CXX11=1 -I. -I.. -I.. -g -c debug_icb.F90  -fPIC -o .libs/debug_icb.o
/opt/intel//compilers_and_libraries_2019.0.117/linux/mpi/intel64/bin/mpiifort: 1: eval: Syntax error: "(" unexpected
Makefile:433: recipe for target 'debug_icb.lo' failed
make[1]: *** [debug_icb.lo] Error 1
make[1]: Leaving directory '/home/pjfasano/Research/code/arpack-ng/ICB'
Makefile:541: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Compiler is mpiifort (Intel). Fails on both most recent commit a26b727, as well as a580f6f. Config command: ./configure --with-blas=mkl_gf_lp64 --with-lapack=mkl_gf_lp64 --enable-mpi --enable-icb

kc9jud commented 5 years ago

Compilation succeeds on 9e7ceb7.

kc9jud commented 5 years ago

I did a git bisect... here's the report:

998b89840e27884fd21b0e424cdd55b56f25632d is the first bad commit
commit 998b89840e27884fd21b0e424cdd55b56f25632d
Author: turboencabulator <elyk03@gmail.com>
Date:   Thu Jan 10 04:12:29 2019 -0600

    Autotools cleanup (#172)

    * Version numbers need to be kept up-to-date

    * arpack.pc:  includedir should match the corresponding ./configure option

    * Override pkgincludedir instead of creating a new directory variable

    * Supplying arguments to AC_OUTPUT is obsolete behavior

    * Distribute the entire source regardless of build options

    Otherwise you won't be able to build ICB/MPI/etc. if the tarball wasn't
    originally built with those options, because those files will be
    missing.  Missing files leads to more breakage.

    DIST_SUBDIRS is handled automatically.

    * Clean up conditional recursion into subdirectories

    Don't need to check for ICB inside a subdirectory if it won't be
    descended into from the parent directory.

    * Fix various include path problems

    Should be using $(top_srcdir), not $(top_builddir).
    -I flags go in CPPFLAGS, not CFLAGS nor FCFLAGS.

    * Minor rearrangement of autoconf macros

    Put all AC_CONFIG_*s together near the end.
    Put all AM_CONDITIONALs together near the end.  These should never be
    conditionally expanded.

    * Run Fortran flag tests against the correct compiler

    * Simplify --enable arguments

    AC_HELP_STRING has been replaced by AS_HELP_STRING.
    Setting enable_foo to $enableval is an unnecessary self-assignment.

    * Fix missing files in the distribution

    * Simplify creation of arpackdef.h

    The ax_gen_arpack.m4 macro would add a bunch of extra garbage to
    arpackdef.h, such as PACKAGE_NAME, VERSION, HAVE_BLAS, etc. that would
    clash if any other project tried to #include it.  Shorten it to only the
    one #define that we care about.

    This file is placed in $(top_builddir) so add that path to CPPFLAGS.
    -I$(top_builddir) should be first.  Note that autoheader would do this,
    but now we don't need to use autoheader.

    Move #include lines inside the include guards.

    * Need PKG_PROG_PKG_CONFIG if first PKG_CHECK_MODULES is conditional

    * Populate the version and URL fields of arpack.pc from CMake

    Still not installing this yet because it doesn't contain full dependency
    info for LAPACK/BLAS.

    * Bump version to 3.7.0

    * Update shared library version

    Updating the minor number (libtool "age") due to the new dbgini/staini
    symbols.  Note that CMake doesn't follow libtool's current:revision:age
    numbering scheme, so care should be taken with any future changes to
    make sure they generate files with the same numbers.

    * Enable checks for eigen3 headers

:100644 100644 1664a5d3150a20db1b25d8bf24a277e4d4be3136 3be5c6672442a41187c7148903dd0b432be766ee M  .gitignore
:100644 100644 aa3ee0b30c54e2ba1a92eb166b29571595837b8b ca6d53ff84c3c4fa0d408f7451f8b44619312b53 M  CMakeLists.txt
:040000 040000 67519ca25a8efa15c29a2c68a5d556e1b473fbf1 c99d07d33aad0c7aaa4969ba4a6c03637575634a M  EXAMPLES
:040000 040000 e69e51a507435dda268df98420e4c7015c0273cc 4ea7ca113ee26b0046eb5530dcc5f73614b1e254 M  ICB
:100644 100644 9c1727aad14e3bcad53f93c8ecdb23813311ea8b ca74213832eced3aabbec9a78b25c43a846ffdf0 M  Makefile.am
:040000 040000 e50ff8792af2ee400e0ffb67b9871913b774bf64 92b5ade1e7a1266e7b1d07c60faed1fb3bd9bfe2 M  PARPACK
:040000 040000 7d396fa672763f8cbc110858b0390478b2f37be4 4cc3556aeb988f851b15cccd9cc7a67d299d7daf M  SRC
:040000 040000 7b58d3ce16be234816c7ce0601f0e1b1447d054d 3c75edc8a6a7f93eedfe9d31481f7c2fadab7a78 M  TESTS
:100644 100644 5f7d4bcb2abe00458800c84559ad37674fcb47cc c53c82daad05501a7166da05dfc775451da2c54b M  arpack.pc.in
:100644 000000 0737a62bff41509fb0d9a2f1aa189141b82f33e4 0000000000000000000000000000000000000000 D  arpackdef.cmake.h.in
:000000 100644 0000000000000000000000000000000000000000 f9bf9157bec80c42798235e77dba8b925800d117 A  arpackdef.h.in
:100644 100644 9dd270196364d2820bde7375c3ff294a0e99a525 acc3d394ac03d00e72b5f62cec1fe722990f07bd M  configure.ac
:040000 040000 f2d8b4748ce3d95ce5df01dfb7fa0dc4387c9fab efcbfe8041da565d7cfd7b0b1644b0b954079e49 M  m4

It seems like this is a big commit... not sure which change broke things.

fghoussen commented 5 years ago

AFK. I can add a build on travis ci on ubuntu 18 with docker when i'm back. @kc9jud cmake ok ? Autotools +GNU ok ?

kc9jud commented 5 years ago

Autotools+GCC: broken Autotools+Intel: broken CMake+GCC: works CMake+Intel: broken, but somewhere else (building issue #46 test, tries to link to MPI_mpicxx_LIBRARY)

fghoussen commented 5 years ago

Check out how #209 will behave...

fghoussen commented 5 years ago

@yurivict , @kc9jud : does cb59186 make a difference ? Quick look at 998b8984 which sounds to be the one to blame: seems all good to me, except maybe that (current was increased instead of revision ?)... Not sure

kc9jud commented 5 years ago

@fghoussen : No change with cb59186...

kc9jud commented 5 years ago

@fghoussen If I run the command in question by hand, I have to delete -DFC_FUNC\(name,NAME\)=name\ ##\ _ -DFC_FUNC_\(name,NAME\)=name\ ##\ _ from the command in order for it to succeed. Where is that macro coming from? Can it be defined somewhere other than the command line?

kc9jud commented 5 years ago

Alright, I think I've tracked down the source of the problem, however I don't know how to fix it properly.

According to the autoconf manual, that macro is defined by AC_FC_WRAPPERS and is for calling Fortran subroutines from C/C++ code. Whatever's going on here, it shouldn't be in the compiler flags as this is compiling a Fortran file.

This macro is generated by https://github.com/opencollab/arpack-ng/blob/f670e731b7077c78771eb25b48f6bf9ca47a490e/configure.ac#L138-L143

There seems to be some discussion about this earlier, online, but that's specifically a problem with linking using the Fortran compiler...

It appears to me that simply removing the AC_FC_WRAPPERS line from configure.ac allows me to build successfully, but I'm skeptical that that's safe... should I submit a PR?

fghoussen commented 5 years ago

Do not remember why AC_FC_WRAPPERS is here !? 7982593d47541633a7d7b722eb699ba55aa0cf21 will tell us...

mpif77 -g -O2 -c -o issue46.o issue46.f /bin/bash ../../../libtool --tag=F77 --mode=link mpif77 -g -O2 -o issue46 issue46.o ../../../PARPACK/SRC/MPI/libparpack.la -llapack -lblas libtool: link: mpif77 -g -O2 -o .libs/issue46 issue46.o ../../../PARPACK/SRC/MPI/.libs/libparpack.so -llapack -lblas mpicc -DPACKAGE_NAME=\"ARPACK-NG\" -DPACKAGE_TARNAME=\"arpack-ng\" -DPACKAGE_VERSION=\"3.7.0\" -DPACKAGE_STRING=\"ARPACK-NG\ 3.7.0\" -DPACKAGE_BUGREPORT=\"https://github.com/opencollab/arpack-ng/issues/\" -DPACKAGE_URL=\"https://github.com/opencollab/arpack-ng/\" -DPACKAGE=\"arpack-ng\" -DVERSION=\"3.7.0\" -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_MPI=1 -DHAVE_MPI=1 -DHAVE_MPI=1 -DHAVE_MPI=1 -DHAVE_CXX11=1 -I. -I../../.. -I../../../ICB -g -O2 -c -o icb_parpack_c-icb_parpack_c.o test -f 'icb_parpack_c.c' || echo './'icb_parpack_c.c /bin/bash ../../../libtool --tag=CC --mode=link mpicc -g -O2 -o icb_parpack_c icb_parpack_c-icb_parpack_c.o ../../../PARPACK/SRC/MPI/libparpack.la -llapack -lblas -lmpi libtool: link: mpicc -g -O2 -o .libs/icb_parpack_c icb_parpack_c-icb_parpack_c.o ../../../PARPACK/SRC/MPI/.libs/libparpack.so -llapack -lblas -lmpi ../../../PARPACK/SRC/MPI/.libs/libparpack.so: undefined reference to mpi_comm_rank_' ../../../PARPACK/SRC/MPI/.libs/libparpack.so: undefined reference tompiallreduce' collect2: error: ld returned 1 exit status

fghoussen commented 5 years ago

There seems to be some discussion about this earlier, online, but that's specifically a problem with linking using the Fortran compiler...

cd41ef6bdcb : try to follow what is said here http://gnu-autoconf.7623.n7.nabble.com/Mixing-Fortran-and-C-how-to-force-the-linking-with-CC-td11049.html

turboencabulator commented 5 years ago

Based on the "set FCLIBS" comment, I'm guessing AC_FC_WRAPPERS should instead be AC_FC_LIBRARY_LDFLAGS.

fghoussen commented 5 years ago

@turboencabulator : thanks ! @kc9jud : I guess 73b66ce0d as you thumbed up ? @yurivict : does it make a difference on freebsd ?

kc9jud commented 5 years ago

@fghoussen Yes and no. 73b66ce fixes the error message described above, but introduces a new error:

> git describe --long --tags --dirty
3.7.0-0-ga580f6f-dirty
> make check
...
/bin/bash ../../../libtool  --tag=CXX   --mode=link mpic++  -g -O2   -o icb_parpack_cpp icb_parpack_cpp-icb_parpack_cpp.o ../../../PARPACK/SRC/MPI/libparpack.la  -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lmpi  -L/opt/intel//compilers_and_libraries_2019.0.117/linux/mpi/intel64/lib/debug_mt -L/opt/intel//compilers_and_libraries_2019.0.117/linux/mpi/intel64/lib -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/opt/intel/compilers_and_libraries_2019.0.117/linux/ipp/lib/intel64 -L/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2019.0.117/linux/tbb/lib/intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2019.0.117/linux/daal/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2019.0.117/linux/daal/../tbb/lib/intel64_lin/gcc4.4 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lmpifort -lmpi -lrt -lpthread -ldl -lgfortran -lm -lquadmath 
libtool: link: mpic++ -g -O2 -o .libs/icb_parpack_cpp icb_parpack_cpp-icb_parpack_cpp.o  ../../../PARPACK/SRC/MPI/.libs/libparpack.so -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -L/opt/intel//compilers_and_libraries_2019.0.117/linux/mpi/intel64/lib/debug_mt -L/opt/intel//compilers_and_libraries_2019.0.117/linux/mpi/intel64/lib -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/opt/intel/compilers_and_libraries_2019.0.117/linux/ipp/lib/intel64 -L/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2019.0.117/linux/tbb/lib/intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2019.0.117/linux/daal/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2019.0.117/linux/daal/../tbb/lib/intel64_lin/gcc4.4 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lmpifort -lmpi -lrt -lpthread -ldl -lgfortran -lm -lquadmath
/usr/bin/ld: warning: libmpi.so.20, needed by /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libmpi_cxx.so, may conflict with libmpi.so.12
/usr/bin/ld: icb_parpack_cpp-icb_parpack_cpp.o: undefined reference to symbol 'MPI_Comm_c2f'
//usr/lib/x86_64-linux-gnu/libmpi.so.20: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

This is running with GCC+OpenMPI still... haven't checked Intel compilers/MPI yet.

fghoussen commented 5 years ago

@kc9jud : you run ubuntu:bionic with update + upgrade ? that's what CI runs ?!... did you set sudo update-alternatives --set mpi \path\to\mpi_intel_or_gnu before testing gcc+openmpi and intel+intelmpi ?

On this line you reported, you get mpic++ (gnu ?) at the beginning of the line and -lmpiifort (intel ?)

/bin/bash ../../../libtool --tag=CXX --mode=link mpic++ -g ... -lmpifort ...

kc9jud commented 5 years ago

Okay, just tested Intel+IMPI:

> FC=ifort F77=ifort CC=icc CXX=icpc MPIFC=mpiifort MPIF77=mpiifort MPICC=mpiicc MPICXX=mpiicpc ./configure --enable-mpi --enable-icb
> make all check

Everything compiles and tests sucessfully.

@fghoussen No, I haven't modified anything with update-alternatives -- however, I realized that in my .bashrc I was running the Intel compilervars.sh which sets a bunch of environment variables. Once I commented that out (and just ran mklvars.sh to get the MKL BLAS variables), I can compile successfully with GCC+OpenMPI.

e0c005e LGTM. @yurivict does it fix the problem on FreeBSD as well?

fghoussen commented 5 years ago

@sylvestre : give a try to https://cirrus-ci.org/guide/FreeBSD/ ?

yurivict commented 4 years ago

Can't reproduce this with the current master branch.