libMesh / TIMPI

Templated Interface to MPI
GNU Lesser General Public License v2.1
12 stars 11 forks source link

Windows Cygwin link error #93

Open DoubleLT opened 2 years ago

DoubleLT commented 2 years ago

Hello, I try to build libmesh under cygwin of windows 11. However, it gives the following link error message during build TIMPI, can someone have any idead?

checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking target system type... x86_64-unknown-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
bchecking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '197609' is supported by ustar format... yes
checking whether GID '197121' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a sed that does not truncate output... /usr/bin/sed
checking Major version... 1
checking Minor version... 8
checking Point version... 0
note: MPI library path not given...
note: MPI library path not given...
checking whether make supports the include directive... yes (GNU style)
checking for mpicxx... no
checking for mpiCC... no
checking for mpicc... no
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
<<< C++ compiler is unknown but accepted gcc version >>>
configure: Seeking a C++ standard between "2014" and "2017"
checking whether g++ supports C++17 features by default... yes
configure: Found C++17 standard support
checking whether g++ supports C++14 features by default... yes
configure: Found C++14 standard support
checking whether g++ supports C++11 features by default... yes
configure: Found C++11 standard support
configure: Using support for C++17 standard
<<< C++ compiler is unknown but accepted gcc version >>>
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
No build methods specified, defaulting to "dbg devel opt"
<<< Configuring with methods "dbg devel opt" >>>
<<< Disabling extra paranoid compiler warnings >>>
<<< Compiler warnings are just warnings >>>
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
note: Checking /lib and /include for MPI
note: Could not find /lib/libmpi(.a/.so/.dylib)
g++ Compiler Does NOT Support MPI...
---------------------------------------------
------- Configuring optional features -------
---------------------------------------------
<<< Configuring library with deprecated code support >>>
<<< Configuring library with exception throwing support >>>
<<< Default floating point is double precision (double) >>>
<<< Configuring library with compile timestamps >>>
<<< Configuring library with warnings >>>
configuring size of processor_id... 4
---------------------------------------------
----- Done configuring optional features ----
---------------------------------------------
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (/usr/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-unknown-cygwin file names to x86_64-unknown-cygwin format... func_convert_file_noop
checking how to convert x86_64-unknown-cygwin file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (/usr/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gfortran option to produce PIC... -DDLL_EXPORT
checking if gfortran PIC flag -DDLL_EXPORT works... yes
checking if gfortran static flag -static works... yes
checking if gfortran supports -c -o file.o... yes
checking if gfortran supports -c -o file.o... (cached) yes
checking whether the gfortran linker (/usr/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking for git... /cygdrive/c/Program Files/Git/cmd/git
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating src/utilities/include/timpi/timpi_version.h
config.status: creating Makefile
config.status: creating timpi.pc
config.status: creating src/Makefile
config.status: creating test/Makefile
config.status: creating bin/timpi-config
config.status: creating test/run_unit_tests.sh
config.status: creating src/utilities/include/timpi/timpi_config.h.tmp
config.status: executing src/utilities/include/timpi/timpi_config.h commands
config.status: creating src/utilities/include/timpi/timpi_config.h - prefix TIMPI for src/utilities/include/timpi/timpi_config.h.tmp defines
config.status: executing depfiles commands
config.status: executing libtool commands

----------------------------------- SUMMARY -----------------------------------

Package version............... : timpi-1.8.0

C++ compiler.................. : g++
Build Methods...................... : dbg devel opt
CPPFLAGS...(dbg)................... : -DDEBUG  
CXXFLAGS...(dbg)................... :  -O0 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long -Wunused -Wpointer-arith -Wformat -Wparentheses -Woverloaded-virtual    

CPPFLAGS...(devel)................. :   
CXXFLAGS...(devel)................. :  -O2 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long -Wunused -Wpointer-arith -Wformat -Wparentheses -Wuninitialized -funroll-loops -fstrict-aliasing -Woverloaded-virtual -Wdisabled-optimization    

CPPFLAGS...(opt)................... : -DNDEBUG  
CXXFLAGS...(opt)................... :  -O2 -felide-constructors -funroll-loops -fstrict-aliasing -Wdisabled-optimization    

Any warnings-to-errors flags.. : 
Any paranoid warning flags.... : 
Install dir................... : /usr/local
Build architecture............ : x86_64-unknown-cygwin
Git revision number........... : 

-------------------------------------------------------------------------------
Optional Packages for Testing:
  MPI......................... : no

Configure complete, now type \'make\' and then \'make install\'.
Making all in src
make[1]: Entering directory '/cygdrive/d/timpi/build/src'
  CXX      apps/version.o
  CXX      parallel/src/libtimpi_dbg_la-communicator.lo
  CXX      parallel/src/libtimpi_dbg_la-message_tag.lo
  CXX      parallel/src/libtimpi_dbg_la-request.lo
  CXX      utilities/src/libtimpi_dbg_la-semipermanent.lo
  CXX      utilities/src/libtimpi_dbg_la-timpi_assert.lo
  CXX      utilities/src/libtimpi_dbg_la-timpi_init.lo
  CXX      utilities/src/libtimpi_dbg_la-timpi_version.lo
  CXXLD    libtimpi_dbg.la
  CXXLD    timpi_version-dbg.exe
libtool: warning: '-version-info' is ignored for programs
  CXX      parallel/src/libtimpi_devel_la-communicator.lo
  CXX      parallel/src/libtimpi_devel_la-message_tag.lo
  CXX      parallel/src/libtimpi_devel_la-request.lo
  CXX      utilities/src/libtimpi_devel_la-semipermanent.lo
  CXX      utilities/src/libtimpi_devel_la-timpi_assert.lo
  CXX      utilities/src/libtimpi_devel_la-timpi_init.lo
  CXX      utilities/src/libtimpi_devel_la-timpi_version.lo
  CXXLD    libtimpi_devel.la
libtool:   error: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified
make[1]: *** [Makefile:867: libtimpi_devel.la] Error 1
make[1]: Leaving directory '/cygdrive/d/timpi/build/src'
make: *** [Makefile:614: all-recursive] Error 1
roystgnr commented 2 years ago

I don't have any ideas about what's wrong, but two ideas to fix it:

1) Run bootstrap first, with the newest autotools in Cygwin. We're a little behind internally, I've seen it cause problems on Apple M1, and it might be a problem on Windows 11 to.

2) Pass LDFLAGS=-no-undefined as another configure option