arpack-ng
arpack-ng copied to clipboard
arpack.h isn't installed on FreeBSD
FreeBSD port seems to be broken: it doesn't install include/arpack.h.
I don't have a freebsd to fix that, don't hesitate to provide a PR! Thanks!
@yurivict : *arpack.h* are installed only if you ./configure --enable-icb. Without --enable-icb, arpack-ng is pure fortran (means no .h/hpp)
@yurivict :
*arpack.h*are installed only if you./configure --enable-icb. Without--enable-icb, arpack-ng is pure fortran (means no .h/hpp)
Is this option exposed through cmake?
Fa sure. In the CMakeLists.txt you can see
option(ICB "Enable support for *[ae]upd_c with ISO_C_BINDING" OFF)
and later it is installed with
if(ICB)
install(FILES arpack.h DESTINATION include/arpack)
install(FILES arpack.hpp DESTINATION include/arpack)
if (MPI)
install(FILES parpack.h DESTINATION include/arpack)
install(FILES parpack.hpp DESTINATION include/arpack)
endif()
endif()
Calling with
cmake -DICB=1 ..
should do the trick.
Fa sure. In the
CMakeLists.txtyou can seeoption(ICB "Enable support for *[ae]upd_c with ISO_C_BINDING" OFF)and later it is installed with
if(ICB) install(FILES arpack.h DESTINATION include/arpack) install(FILES arpack.hpp DESTINATION include/arpack) if (MPI) install(FILES parpack.h DESTINATION include/arpack) install(FILES parpack.hpp DESTINATION include/arpack) endif() endif()Calling with
cmake -DICB=1 ..should do the trick.
Thank you that works but I am running into another issue.
The iso_c_bind test passes but then linking the fortran file fails:
[ 13%] Building Fortran object CMakeFiles/arpack.dir/SRC/cgetv0.f.o
F90-S-0034-Syntax error at or near & (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 8)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 9)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 10)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 11)
F90-S-0034-Syntax error at or near & (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 12)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 13)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 14)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 15)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/debug.h: 16)
F90-S-0034-Syntax error at or near end of line (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 12)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 13)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 14)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 15)
F90-S-0034-Syntax error at or near end of line (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 16)
F90-S-0034-Syntax error at or near identifier px (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 17)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 18)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 19)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 20)
F90-S-0034-Syntax error at or near , (/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/stat.h: 21)
0 inform, 0 warnings, 19 severes, 0 fatal for cgetv0
I need to pass "-c" to tell this fortran compiler to preprocess the files as you can see from this command
/usr/local/flang/bin/flang -c ../SRC/cgetv0.f -o test
root@12amd64-FLANG:/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build # readelf -s test
Symbol table (.symtab) contains 50 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS cgetv0-370c42.ll
2: 0000000000000000 60 OBJECT LOCAL DEFAULT 5 .BSS1
3: 0000000000000100 4 OBJECT LOCAL DEFAULT 7 .C283_cgetv0_
4: 0000000000000130 4 OBJECT LOCAL DEFAULT 7 .C285_cgetv0_
5: 0000000000000138 8 OBJECT LOCAL DEFAULT 7 .C286_cgetv0_
6: 0000000000000078 4 OBJECT LOCAL DEFAULT 7 .C287_cgetv0_
7: 0000000000000104 4 OBJECT LOCAL DEFAULT 7 .C311_cgetv0_
8: 0000000000000120 4 OBJECT LOCAL DEFAULT 7 .C373_cgetv0_
9: 0000000000000118 8 OBJECT LOCAL DEFAULT 7 .C374_cgetv0_
10: 0000000000000134 4 OBJECT LOCAL DEFAULT 7 .C380_cgetv0_
11: 00000000000000f0 8 OBJECT LOCAL DEFAULT 7 .C385_cgetv0_
12: 00000000000000e8 8 OBJECT LOCAL DEFAULT 7 .C386_cgetv0_
13: 0000000000000108 8 OBJECT LOCAL DEFAULT 7 .C392_cgetv0_
14: 0000000000000128 8 OBJECT LOCAL DEFAULT 7 .C407_cgetv0_
15: 0000000000000110 4 OBJECT LOCAL DEFAULT 7 .C408_cgetv0_
16: 00000000000000fc 4 OBJECT LOCAL DEFAULT 7 .C410_cgetv0_
17: 00000000000000fa 1 OBJECT LOCAL DEFAULT 7 .C412_cgetv0_
18: 00000000000000f9 1 OBJECT LOCAL DEFAULT 7 .C415_cgetv0_
19: 00000000000000f8 1 OBJECT LOCAL DEFAULT 7 .C419_cgetv0_
20: 00000000000000e0 1 OBJECT LOCAL DEFAULT 7 .C420_cgetv0_
21: 00000000000000d8 8 OBJECT LOCAL DEFAULT 7 .C421_cgetv0_
22: 00000000000000b0 38 OBJECT LOCAL DEFAULT 7 .C424_cgetv0_
23: 0000000000000080 37 OBJECT LOCAL DEFAULT 7 .C425_cgetv0_
24: 000000000000007c 4 OBJECT LOCAL DEFAULT 7 .C426_cgetv0_
25: 0000000000000040 53 OBJECT LOCAL DEFAULT 7 .C427_cgetv0_
26: 0000000000000010 43 OBJECT LOCAL DEFAULT 7 .C428_cgetv0_
27: 0000000000000000 4 OBJECT LOCAL DEFAULT 7 .C429_cgetv0_
28: 0000000000000000 0 NOTYPE LOCAL DEFAULT 4 .LCPI0_0
29: 0000000000000000 4 OBJECT LOCAL DEFAULT 6 .STATICS1
30: 0000000000000000 0 SECTION LOCAL DEFAULT 2
31: 0000000000000000 0 SECTION LOCAL DEFAULT 5
32: 0000000000000000 0 SECTION LOCAL DEFAULT 6
33: 0000000000000000 0 SECTION LOCAL DEFAULT 7
34: 0000000000000000 0 SECTION LOCAL DEFAULT 8
35: 0000000000000000 0 SECTION LOCAL DEFAULT 9
36: 0000000000000000 0 SECTION LOCAL DEFAULT 10
37: 0000000000000000 0 SECTION LOCAL DEFAULT 21
38: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND arscnd_
39: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND ccopy_
40: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND cdotc_
41: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND cgemv_
42: 0000000000000000 3998 FUNC GLOBAL DEFAULT 2 cgetv0_
43: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND clarnv_
44: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND cvout_
45: 0000000000000040 96 OBJECT GLOBAL DEFAULT COM debug_
46: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND scnrm2_
47: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND slapy2_
48: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND svout_
49: 0000000000000040 124 OBJECT GLOBAL DEFAULT COM timing_
I've tried adding that flag to my LDFLAGS but that doesn't work. It seems as if the flags aren't being interpreted properly.
Here's the output from cmake's configure:
cmake -DICB=ON ../
-- The C compiler identification is Clang 5.0.1
-- The Fortran compiler identification is Flang 99.99.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working Fortran compiler: /usr/local/bin/flang
-- Check for working Fortran compiler: /usr/local/bin/flang -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/flang supports Fortran 90
-- Checking whether /usr/local/bin/flang supports Fortran 90 -- yes
-- The CXX compiler identification is Clang 5.0.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Fortran compiler does support iso_c_binding.
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found BLAS: /usr/local/lib/libblas.so
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Configuration summary for arpack-ng-3.6.0:
-- prefix: /usr/local
-- MPI: OFF
-- ICB: ON
-- FC: /usr/local/bin/flang
-- FCFLAGS: -O3 -DNDEBUG -Wl,-rpath=/usr/local/flang/lib -Wl,-rpath=/usr/local/llvm60/lib -I/usr/local/flang/include -I/usr/local/llvm60/include -L/usr/local/flang/lib -L/usr/local/llvm60/lib -lm -lflang -lflangmain -lflangrti -lomptarget -lompstub -lomp -lpgmath -lmp -lexecinfo
-- CC: /usr/bin/cc
-- CCFLAGS: -O3 -DNDEBUG
-- CXX: /usr/bin/c++
-- CXXFLAGS: -O3 -DNDEBUG
-- BLAS:
-- link: /usr/local/lib/libblas.so
-- LAPACK:
-- link: /usr/local/lib/liblapack.so
-- link: /usr/local/lib/libblas.so
-- Configuring done
-- Generating done
I tried modifying the CMakefiles to pass but that's not working as expected.
How can I pass the -c flag to the fortran compiler before attempting to compile those iso_c_bind files?
@teamblubee : didn't even know about flang ! :D Did you try FCFLAGS="-c" cmake -DICB=ON ..; make
@teamblubee : didn't even know about flang ! :D Did you try
FCFLAGS="-c" cmake -DICB=ON ..; make
I did try setting that env variable but it's a no go.
edit
I looked at the makefile rules generated by cmake for CMakeFiles/icb_arpack_c.dir/flags.make
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.12
# compile C with /usr/bin/cc
C_FLAGS = -O3 -DNDEBUG
C_DEFINES =
C_INCLUDES = -I/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build -I/arpack-ng
/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1
which gets added to this other autogenerated file: CMakeFiles/arpack.dir/flags.make
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.12
# compile Fortran with /usr/local/bin/flang
Fortran_FLAGS = -Wl,-rpath=/usr/local/flang/lib -Wl,-rpath=/usr/local/llvm60/lib -I/usr/local/flang/include -I/usr/local/llvm60/include -L/usr/local/flang/lib -L/usr/local/llvm60/lib -lm -lflang -lflangmain -lflangrti -lomptarget -lompstub -lomp -lpgmath -lmp -lexecinfo -O3 -DNDEBUG
Fortran_DEFINES =
Fortran_INCLUDES = -I/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build -I/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.12
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/local/bin/cmake
# The command to remove a file.
RM = /usr/local/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build
# Include any dependencies generated for this target.
include CMakeFiles/arpack.dir/depend.make
# Include the progress variables for this target.
include CMakeFiles/arpack.dir/progress.make
# Include the compile flags for this target's objects.
include CMakeFiles/arpack.dir/flags.make
CMakeFiles/arpack.dir/UTIL/icnteq.f.o: CMakeFiles/arpack.dir/flags.make
CMakeFiles/arpack.dir/UTIL/icnteq.f.o: ../UTIL/icnteq.f
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building Fortran object CMakeFiles/arpack.dir/UTIL/icnteq.f.o"
/usr/local/bin/flang $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -c /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/UTIL/icnteq.f -o CMakeFiles/arpack.dir/UTIL/icnteq.f.o
CMakeFiles/arpack.dir/UTIL/icnteq.f.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing Fortran source to CMakeFiles/arpack.dir/UTIL/icnteq.f.i"
/usr/local/bin/flang $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -E /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/UTIL/icnteq.f > CMakeFiles/arpack.dir/UTIL/icnteq.f.i
CMakeFiles/arpack.dir/build.make
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.12
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/local/bin/cmake
# The command to remove a file.
RM = /usr/local/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build
# Include any dependencies generated for this target.
include CMakeFiles/arpack.dir/depend.make
# Include the progress variables for this target.
include CMakeFiles/arpack.dir/progress.make
# Include the compile flags for this target's objects.
include CMakeFiles/arpack.dir/flags.make
CMakeFiles/arpack.dir/UTIL/icnteq.f.o: CMakeFiles/arpack.dir/flags.make
CMakeFiles/arpack.dir/UTIL/icnteq.f.o: ../UTIL/icnteq.f
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building Fortran object CMakeFiles/arpack.dir/UTIL/icnteq.f.o"
/usr/local/bin/flang $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -c /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/UTIL/icnteq.f -o CMakeFiles/arpack.dir/UTIL/icnteq.f.o
CMakeFiles/arpack.dir/UTIL/icnteq.f.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing Fortran source to CMakeFiles/arpack.dir/UTIL/icnteq.f.i"
/usr/local/bin/flang $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -E /wrkdirs/usr/ports/math/arpack-ng/work/arpack-ng-60cea47bd67cbceb6512edfdd01d49ce7cbe65d1/UTIL/icnteq.f > CMakeFiles/arpack.dir/UTIL/icnteq.f.i
either I'm not properly setting the defines or they aren't being detected. Here's what my env looks like
FLANG=/usr/local/flang/bin/flang
FFLAGS=-Wl,-rpath=/usr/local/flang/lib -Wl,-rpath=/usr/local/llvm60/lib -I/usr/local/flang/include -I/usr/local/llvm60/include -L/usr/local/flang/lib -L/usr/local/llvm60/lib -lm -lflang -lflangmain -lflangrti -lomptarget -lompstub -lomp -lpgmath -lmp -lexecinfo
FCFLAGS=-c
C_DEFINES=-c
C_INCLUDES=-c
CCFLAGS=-O3 -DNDEBUG -c
Fortran_FLAGS=-c
Did you try CMAKE_Fortran_FLAGS="-c" cmake ..; make and / or add "-c" with ccmake ?
Did you try
CMAKE_Fortran_FLAGS="-c" cmake ..; makeand / or add "-c" with ccmake ?
I tried fiddling with cmake for a while, it didn't work and I cannot undo it.
I was able to pass the proper flags using the configure and make scripts and successfully build the project.
@teamblubee : sometimes with cmake you need to rm -fr * the build directory !... Did you try. Anyway, if configure is OK, that's good as you have a solution !
Should be fixed by now: reopen this issue otherwise.