Closed jschueller closed 7 months ago
Hmmm.. It should have failed earlier during cross-compilation.
Do the cross-compilation instructions help? https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/GraphBLAS/JITpackage#cross-compilation
not really, there should not be additional flags needed for the native build since its just a simple linux/gcc platform I just noticed the GraphBLAS/JITpackage/native subdir that should contain the configured native build is created but empty
How should CMake guess the native toolchain that you'd like to use if you don't supply that information?
Does it work if you follow the cross-compilation instructions?
no, the native directory is still empty even with the added toolchain file
Could you please show the complete list of cmake flags that you use to configure SuiteSparse?
yes:
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-w64-mingw32 \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-w64-mingw32/include \
-DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-w64-mingw32/include \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake \
-DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/x86_64-w64-mingw32-wine \
-DSUITESPARSE_DEMOS=OFF -DBUILD_TESTING=OFF -DBLA_VENDOR=Generic \
-DGRAPHBLAS_CROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain-native.cmake" ..
Could you please show the content of /usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake
and of /tmp/toolchain-native.cmake
?
toolchain-x86_64-w64-mingw32.cmake:
set (CMAKE_SYSTEM_NAME Windows)
set (CMAKE_SYSTEM_PROCESSOR x86_64)
# specify the cross compiler
set (CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set (CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
# where is the target environment
set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
# search for programs in the build host directories
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# Make sure Qt can be detected by CMake
set (QT_BINARY_DIR /usr/x86_64-w64-mingw32/bin /usr/bin)
set (QT_INCLUDE_DIRS_NO_SYSTEM ON)
set (QT_HOST_PATH "/usr" CACHE PATH "host path for Qt")
# set the resource compiler (RHBZ #652435)
set (CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
set (CMAKE_MC_COMPILER x86_64-w64-mingw32-windmc)
# override boost thread component suffix as mingw-w64-boost is compiled with threadapi=win32
set (Boost_THREADAPI win32)
# These are needed for compiling lapack (RHBZ #753906)
set (CMAKE_Fortran_COMPILER x86_64-w64-mingw32-gfortran)
set (CMAKE_AR:FILEPATH x86_64-w64-mingw32-ar)
set (CMAKE_RANLIB:FILEPATH x86_64-w64-mingw32-ranlib)
and toolchain-native.cmake is taken from the doc
That is not the toolchain that corresponds to the original error. Do you get a similar error with that toolchain file, too? Which error do you see?
Could you also please show the output of the following command? (Note the --fresh
)
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-w64-mingw32 \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-w64-mingw32/include \
-DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-w64-mingw32/include \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake \
-DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/x86_64-w64-mingw32-wine \
-DSUITESPARSE_DEMOS=OFF -DBUILD_TESTING=OFF -DBLA_VENDOR=Generic -DGRAPHBLAS_CROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain-native.cmake" --fresh ..
yes I was trying with x86_64-w64-mingw32 too but with the same error
no need for --fresh as I delete everything between the different tries
Can you show the output anyway? (Maybe, upload a text file with the output instead of pasting it here.)
Which command did you run? That output is for a i686 target again?
We really need to be sure to be on the same page. Otherwise, it will be really difficult to help you...
yes, I got back to i686, lets stick with that
Then please show the content of the toolchain file that you actually use...
its exactly the same but with i686 instead of x86_64
maybe its best if I configure the native build myself and pass GrBJITPackageGenerator_DIR
Could you please show the output of cmake --build .
?
There should be a section akin of this:
[ 51%] Built target SPEX
gmake[5]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
gmake[5]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
gmake[5]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
[ 51%] [34m[1mCreating directories for 'jitpackage_generator_native'[0m
[ 51%] [34m[1mNo download step for 'jitpackage_generator_native'[0m
[ 51%] [34m[1mNo update step for 'jitpackage_generator_native'[0m
[ 51%] [34m[1mNo patch step for 'jitpackage_generator_native'[0m
[ 51%] [34m[1mPerforming configure step for 'jitpackage_generator_native'[0m
-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native
[ 51%] [34m[1mPerforming build step for 'jitpackage_generator_native'[0m
gmake[6]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
gmake[7]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
gmake[8]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
gmake[8]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
gmake[8]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
[ 50%] [32mBuilding C object CMakeFiles/grb_jitpackage.dir/Source/grb_jitpackage.c.o[0m
[100%] [32m[1mLinking C executable grb_jitpackage[0m
gmake[8]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
[100%] Built target grb_jitpackage
gmake[7]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
gmake[6]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build/GraphBLAS/JITpackage/native'
[ 51%] [34m[1mNo install step for 'jitpackage_generator_native'[0m
[ 52%] [34m[1mCompleted 'jitpackage_generator_native'[0m
gmake[5]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
[ 52%] Built target jitpackage_generator_native
gmake[5]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
gmake[5]: Leaving directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
gmake[5]: Entering directory '/home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build'
-- Source: /home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0
-- Build: /home/osboxes/repo/mxe-octave/tmp-suitesparse/SuiteSparse-7.4.0/build
-- Install lib: lib
-- Install include: include/suitesparse
-- Install bin: bin
-- Install pkg-file: lib
I'd be interested to see what it says.
Just a hunch: Could you try setting the full path to your native C compiler in the native toolchain file?
no need, we can see from the logs the native executable grb_jitpackage is built successfully: build.txt
Do you see in which directory it created that native generator grb_jitpackage
?
It should be in GraphBLAS/JITpackage/native
in the build tree. But you wrote that directory is empty.
it was empty at configuration, but I guess its populated during the build
So, was it there when the build failed?
I just tried cross-compiling SuiteSparse 7.5.0 from Ubuntu 23.10 (x86_64) to x86_64-w64-mingw32. That is working here.
Your build seems to be heavily parallel. Maybe, the processes are faster than the file system can catch up. Could you try building with less parallel jobs? Maybe, make -j8
? Or if that still fails make -j1
?
Does that make a difference?
I can try but that will take forever
Try adding -DGRAPHBLAS_COMPACT=ON
to your configuration flags. That should speed it up a lot.
If that works, maybe the following could be a workaround for heavily parallel builds:
cmake [-D... configuration flags here] ..
cmake --build . --target jitpackage_generator_native
sleep 1 # let the file system catch up with the generated files
cmake --build .
"make jitpackage_generator_native" first does not help
Does it build the generator? I.e., can you find the binary in GraphBLAS/JITpackage/native in the build tree.
yes it is built
Good 👍
Does the following sequence of commands work?
cmake [-D... configuration flags here] ..
cmake --build . --target jitpackage_generator_native
sleep 1 # let the file system catch up with the generated files
cmake .. # reconfigure after the generator was built
cmake --build . # build all libraries
no, still the same error
Could you please show the output of the cmake ..
step (the one after the generator has been built)?
I think the interesting part is that it tells that the GrBJITPackageGenerator package is not found but if I manually pass -DGrBJITPackageGenerator_DIR=$PWD/GraphBLAS/JITpackage/native then it succeeds
Sorry. Had to leave yesterday.
That's surprising. I would have expected that the PATHS
hint to find_package
would be equivalent...
Could you please apply the following change and show the output?
diff --git a/GraphBLAS/JITpackage/CMakeLists.txt b/GraphBLAS/JITpackage/CMakeLists.txt
index 09094bc14..6860d5469 100644
--- a/GraphBLAS/JITpackage/CMakeLists.txt
+++ b/GraphBLAS/JITpackage/CMakeLists.txt
@@ -15,6 +15,12 @@ set ( GRAPHBLAS_CROSS_TOOLCHAIN_FLAGS_NATIVE "" CACHE STRING
if ( CMAKE_CROSSCOMPILING )
+ message ( STATUS " Cross-compiling" )
+ message ( STATUS " PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}" )
+ message ( STATUS " Files in PROJECT_BINARY_DIR/native:" )
+ file ( GLOB _native_files ${PROJECT_BINARY_DIR}/native/* )
+ message ( STATUS " ${_native_files}" )
+
cmake_path ( GET PROJECT_BINARY_DIR FILENAME _subdir )
if ( ${_subdir} STREQUAL "native" )
message ( FATAL_ERROR "Native toolchain not configured correctly" )
Which version of CMake do you use?
yes, paths are ok, its the find_package that does not work for some reason I use latest cmake 3.28.1, but I tried 3.22 also with the same result
Thanks for testing. Could you please show the output?
To be specific: The first round configuring, I see this:
-- Building dynamic GraphBLAS library (no static)
-- Cross-compiling
-- PROJECT_BINARY_DIR: D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage
-- Files in PROJECT_BINARY_DIR/native:
--
The second time (during cmake --build .
), I see this (on Windows/MinGW currently):
-- Cross-compiling
-- PROJECT_BINARY_DIR: D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage
-- Files in PROJECT_BINARY_DIR/native:
-- D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage/native/CMakeCache.txt;D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage/native/CMakeFiles;D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage/native/GrBJITPackageGeneratorConfig.cmake;D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage/native/Makefile;D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage/native/cmake_install.cmake;D:/repo/SuiteSparse/SuiteSparse/build-ucrt64/GraphBLAS/JITpackage/native/grb_jitpackage.exe
Could you please show (at least) the relevant parts of the build log?
here is the output we can see the cmake config file is there on the second configure (here with graphblas only): cmake.log
but if I add
set(GrBJITPackageGenerator_DIR ${PROJECT_BINARY_DIR}/native)
before the find_package instruction it gets found !?
I also tried unsetting GrBJITPackageGenerator_DIR from cache (from first configure) but that didnt work
It's really strange that setting GrBJITPackageGenerator_DIR
to that directory would make a difference. To the GLOB
expression that directory seems to be empty...
I'd still suspect that this is a filesystem cache issue with the highly parallel build.
Did running a "less parallel" make
make a difference?
Alternatively, does the following sequence of commands make a difference?
cmake [-D... configuration flags here] ..
cmake --build . --target jitpackage_generator_native
sync # trigger a flush of the filesystem cache
sleep 4 # according to the documentation it might still take "a few seconds" after `sync` before the filesystem is current
cmake .. # reconfigure after the generator was built
cmake --build . # build all libraries
I specifically built the target that generates the source file, so no parallel build is involved here
I specifically built the target that generates the source file, so no parallel build is involved here
How much time did pass between building the generator and starting the configuration again in your test?
Oops. Misread the log...
I still don't understand why it's working in all test environments here. Maybe, the find_package
command stumbles over double forward slashes //
in the path on your end?
If overriding that variable fixes the issue for you, that might be what we should do...
I opened #740 that tests the cross-compilation rules by getting CMake into "thinking" that it is cross-compiling. That seems to be working also on the CI infrastructure without the changes from #738.
It would really be interesting to understand why #738 is needed on your end. But even if we can't find the reason, the proposed patch probably doesn't do any harm either.
yes, maybe we should debug it further
yes, maybe we should debug it further
Since I can't reproduce the issue anywhere, I probably won't be of much help in tracking the actual cause down (apart from just guessing wildly). One of those wild guesses: Does it make a difference if you replace the double slash //
in the path to the build tree with a single slash /
?
no, the double slash does not matter I'm using archlinux, but I can reproduce also from my docker container:
FROM openturns/archlinux-mingw
WORKDIR /tmp
RUN git clone --depth 1 https://github.com/DrTimothyAldenDavis/GraphBLAS.git
RUN cd GraphBLAS && /usr/bin/x86_64-w64-mingw32-cmake . && make GB_JITpackage && make GB_JITpackage
it yields:
Step 1/4 : FROM openturns/archlinux-mingw
---> a9e00a8ceca5
Step 2/4 : WORKDIR /tmp
---> Running in 3f85e7aa5102
Removing intermediate container 3f85e7aa5102
---> 09cb0477a94f
Step 3/4 : RUN git clone --depth 1 https://github.com/DrTimothyAldenDavis/GraphBLAS.git
---> Running in a7869c6d2250
Cloning into 'GraphBLAS'...
Removing intermediate container a7869c6d2250
---> a1b8e456775f
Step 4/4 : RUN cd GraphBLAS && /usr/bin/x86_64-w64-mingw32-cmake . && make GB_JITpackage && make GB_JITpackage
---> Running in 88ce329c9a87
-- The C compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/sbin/x86_64-w64-mingw32-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Building SuiteSparse:GraphBLAS version: v9.0.0, date: Jan 10, 2024
-- GraphBLAS C API: v2.1, date: Dec 22, 2023
-- Source: /tmp/GraphBLAS
-- Build: /tmp/GraphBLAS
-- Install lib: lib
-- Install include: include/suitesparse
-- Install bin: bin
-- Install pkg-file: lib
-- Install rpath: $ORIGIN
-- Build rpath:
-- Build type: None
-- The Fortran compiler identification is GNU 13.2.1
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/sbin/x86_64-w64-mingw32-gfortran - skipped
-- Fortran: /usr/sbin/x86_64-w64-mingw32-gfortran
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- CUDA: not found
-- CUDA: not enabled
-- GraphBLAS CUDA JIT: disabled
-- GraphBLAS CPU JIT: enabled
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5") found components: C
-- GraphBLAS has OpenMP: ON
-- cpu_features (by google.com): enabled
-- Building dynamic GraphBLAS library (no static)
-- Could NOT find GrBJITPackageGenerator (missing: GrBJITPackageGenerator_DIR)
-- Looking for fmax
-- Looking for fmax - found
-- Performing Test TEST_FOR_STDATOMIC
-- Performing Test TEST_FOR_STDATOMIC - Success
-- C11 atomics: OK. -latomic not needed
-- CMAKE OpenMP libraries: /usr/x86_64-w64-mingw32/lib/libgomp.dll.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a
-- CMAKE OpenMP include:
-- CMAKE OpenMP C flags: -fopenmp
-- CMAKE C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG
-- Skipping the demos in GraphBLAS/Demo
-- ------------------------------------------------------------------------
-- JIT configuration:
-- ------------------------------------------------------------------------
-- JIT C compiler:
-- JIT C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fPIC
-- JIT link flags: -Wl,-O1,--sort-common,--as-needed -fstack-protector -shared
-- JIT lib prefix: lib
-- JIT lib suffix: .dll
-- JIT obj suffix: .o
-- JIT cache: /home/devel/.SuiteSparse/GrB9.0.0
-- JIT openmp inc:
-- JIT openmp dirs
-- JIT libraries: -lgomp -lmingwthrd -lmingwthrd
-- JIT cmake libs: /usr/x86_64-w64-mingw32/lib/libgomp.dll.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a
-- ------------------------------------------------------------------------
-- CMAKE report for: GraphBLAS
-- ------------------------------------------------------------------------
-- inside common SuiteSparse root: OFF
-- install in SuiteSparse/lib and SuiteSparse/include: OFF
-- build type: None
-- BUILD_SHARED_LIBS: ON
-- BUILD_STATIC_LIBS: OFF
-- C compiler: /usr/sbin/x86_64-w64-mingw32-gcc
-- C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG
-- C Flags release: -O3 -DNDEBUG
-- compile definitions: _CRT_SECURE_NO_WARNINGS
-- ------------------------------------------------------------------------
-- Configuring done (2.7s)
-- Generating done (0.5s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_CROSSCOMPILING_EMULATOR
CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
-- Build files have been written to: /tmp/GraphBLAS
[ 0%] Creating directories for 'jitpackage_generator_native'
[ 0%] No download step for 'jitpackage_generator_native'
[100%] No update step for 'jitpackage_generator_native'
[100%] No patch step for 'jitpackage_generator_native'
[100%] Performing configure step for 'jitpackage_generator_native'
-- The C compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/sbin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/GraphBLAS/JITpackage/native
[100%] Performing build step for 'jitpackage_generator_native'
[ 50%] Building C object CMakeFiles/grb_jitpackage.dir/Source/grb_jitpackage.c.o
[100%] Linking C executable grb_jitpackage
[100%] Built target grb_jitpackage
[100%] No install step for 'jitpackage_generator_native'
[100%] Completed 'jitpackage_generator_native'
[100%] Built target jitpackage_generator_native
-- Building SuiteSparse:GraphBLAS version: v9.0.0, date: Jan 10, 2024
-- GraphBLAS C API: v2.1, date: Dec 22, 2023
-- Source: /tmp/GraphBLAS
-- Build: /tmp/GraphBLAS
-- Install lib: lib
-- Install include: include/suitesparse
-- Install bin: bin
-- Install pkg-file: lib
-- Install rpath: $ORIGIN
-- Build rpath:
-- Build type: None
-- Fortran: /usr/sbin/x86_64-w64-mingw32-gfortran
-- CUDA: not found
-- CUDA: not enabled
-- GraphBLAS CUDA JIT: disabled
-- GraphBLAS CPU JIT: enabled
-- GraphBLAS has OpenMP: ON
-- cpu_features (by google.com): enabled
-- Building dynamic GraphBLAS library (no static)
-- Could NOT find GrBJITPackageGenerator (missing: GrBJITPackageGenerator_DIR)
-- C11 atomics: OK. -latomic not needed
-- CMAKE OpenMP libraries: /usr/x86_64-w64-mingw32/lib/libgomp.dll.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a
-- CMAKE OpenMP include:
-- CMAKE OpenMP C flags: -fopenmp
-- CMAKE C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG
-- Skipping the demos in GraphBLAS/Demo
-- ------------------------------------------------------------------------
-- JIT configuration:
-- ------------------------------------------------------------------------
-- JIT C compiler:
-- JIT C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fPIC
-- JIT link flags: -Wl,-O1,--sort-common,--as-needed -fstack-protector -shared
-- JIT lib prefix: lib
-- JIT lib suffix: .dll
-- JIT obj suffix: .o
-- JIT cache: /home/devel/.SuiteSparse/GrB9.0.0
-- JIT openmp inc:
-- JIT openmp dirs
-- JIT libraries: -lgomp -lmingwthrd -lmingwthrd
-- JIT cmake libs: /usr/x86_64-w64-mingw32/lib/libgomp.dll.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a
-- ------------------------------------------------------------------------
-- CMAKE report for: GraphBLAS
-- ------------------------------------------------------------------------
-- inside common SuiteSparse root: OFF
-- install in SuiteSparse/lib and SuiteSparse/include: OFF
-- build type: None
-- BUILD_SHARED_LIBS: ON
-- BUILD_STATIC_LIBS: OFF
-- C compiler: /usr/sbin/x86_64-w64-mingw32-gcc
-- C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG
-- C Flags release: -O3 -DNDEBUG
-- compile definitions: _CRT_SECURE_NO_WARNINGS
-- ------------------------------------------------------------------------
-- Configuring done (0.7s)
-- Generating done (0.6s)
-- Build files have been written to: /tmp/GraphBLAS
[100%] Built target Reconfigure
[100%] Built target GB_JITpackage
[100%] Built target jitpackage_generator_native
-- Building SuiteSparse:GraphBLAS version: v9.0.0, date: Jan 10, 2024
-- GraphBLAS C API: v2.1, date: Dec 22, 2023
-- Source: /tmp/GraphBLAS
-- Build: /tmp/GraphBLAS
-- Install lib: lib
-- Install include: include/suitesparse
-- Install bin: bin
-- Install pkg-file: lib
-- Install rpath: $ORIGIN
-- Build rpath:
-- Build type: None
-- Fortran: /usr/sbin/x86_64-w64-mingw32-gfortran
-- CUDA: not found
-- CUDA: not enabled
-- GraphBLAS CUDA JIT: disabled
-- GraphBLAS CPU JIT: enabled
-- GraphBLAS has OpenMP: ON
-- cpu_features (by google.com): enabled
-- Building dynamic GraphBLAS library (no static)
-- Could NOT find GrBJITPackageGenerator (missing: GrBJITPackageGenerator_DIR)
-- C11 atomics: OK. -latomic not needed
-- CMAKE OpenMP libraries: /usr/x86_64-w64-mingw32/lib/libgomp.dll.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a
-- CMAKE OpenMP include:
-- CMAKE OpenMP C flags: -fopenmp
-- CMAKE C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG
-- Skipping the demos in GraphBLAS/Demo
-- ------------------------------------------------------------------------
-- JIT configuration:
-- ------------------------------------------------------------------------
-- JIT C compiler:
-- JIT C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fPIC
-- JIT link flags: -Wl,-O1,--sort-common,--as-needed -fstack-protector -shared
-- JIT lib prefix: lib
-- JIT lib suffix: .dll
-- JIT obj suffix: .o
-- JIT cache: /home/devel/.SuiteSparse/GrB9.0.0
-- JIT openmp inc:
-- JIT openmp dirs
-- JIT libraries: -lgomp -lmingwthrd -lmingwthrd
-- JIT cmake libs: /usr/x86_64-w64-mingw32/lib/libgomp.dll.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a;/usr/x86_64-w64-mingw32/lib/libmingwthrd.a
-- ------------------------------------------------------------------------
-- CMAKE report for: GraphBLAS
-- ------------------------------------------------------------------------
-- inside common SuiteSparse root: OFF
-- install in SuiteSparse/lib and SuiteSparse/include: OFF
-- build type: None
-- BUILD_SHARED_LIBS: ON
-- BUILD_STATIC_LIBS: OFF
-- C compiler: /usr/sbin/x86_64-w64-mingw32-gcc
-- C flags: -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG
-- C Flags release: -O3 -DNDEBUG
-- compile definitions: _CRT_SECURE_NO_WARNINGS
-- ------------------------------------------------------------------------
-- Configuring done (0.7s)
-- Generating done (0.5s)
-- Build files have been written to: /tmp/GraphBLAS
[100%] Built target Reconfigure
[100%] Built target GB_JITpackage
Removing intermediate container 88ce329c9a87
---> dff4db9c1e2a
Successfully built dff4db9c1e2a
Describe the bug graphblas fails to link when cross-compiling, it seems some native target generating that source file is not triggered: https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/dev/GraphBLAS/JITpackage/CMakeLists.txt#L68
To Reproduce use mingw from linux
Expected behavior links succeeds
Screenshots
Desktop (please complete the following information):
Additional context configuring with cmake -DSUITESPARSE_DEMOS=OFF -DBUILD_TESTING=OFF -DBLA_VENDOR=Generic ..., make install
succeeds if I disable jit: cmake -DGRAPHBLAS_USE_JIT=OFF
/cc @mmuetzel