emusolutions / LAGraph

This is a library plus a test harness for collecting algorithms that use the GraphBLAS
Other
0 stars 0 forks source link

CMake Refactor for LC Builds #2

Closed jamesETsmith closed 1 year ago

jamesETsmith commented 1 year ago

General

This PR refactors the cmake build system of LAGraph so we can link to LC builds of LucataGraphBLAS. Many of these changes are intended as temporary patches to help developers build LAGraph against LucataGraphBLAS until GraphBLAS/LAGraph#161 is resolved.

Details

The refactoring involved a couple of things:

  1. Removing support for dynamic libraries (this was the main problem, I proposed a more elegant solution in GraphBLAS/LAGraph#161)
  2. Turning off compilation of experimental/benchmarks when performing an LC build (this was due to stack frame size limits). See emusolutions/llvm-cilk#969. This is already fixed in the development versions of the toolchain and will become unnecessary after the next major toolchain release.
  3. Turning off all rpath flags when performing an LC build (because our compiler doesn't support rpath flags)

Using These Changes

My hope is that people who already have scripts to build LAGraph against LucataGraphBLAS should see no change in behavior. With that said we encourage devs to use the simplified approach made possible by this PR. See the first section of README.md for details. The quick version is below:

Linking against x86 LucataGraphBLAS

cmake -B build -DGRAPHBLAS_ROOT=/path/to/LucataGraphBLAS/build/install
cmake --build build --parallel 16

Linking against LC LucataGraphBLAS

If you want to compile with the Lucata toolchain (i.e. emu-cc.sh) then you MUST point cmake to an LC build of LucataGraphBLAS AND tell cmake to use emu-cc.sh as your compilers. For example:

cmake -B build_lc -DGRAPHBLAS_ROOT=/path/to/LucataGraphBLAS/build_lc/install \
    -DCMAKE_C_COMPILER=/tools/lucata/bin/emu-cc.sh \
    -DCMAKE_CXX_COMPILER=/tools/lucata/bin/emu-cc.sh
cmake --build build_lc --parallel 16
jamesETsmith commented 1 year ago

@moonwatcher let me know if you think this needs more documentation. I added more defaults to our build system so users should only have to specify 1-3 cmake args making build scripts unnecessary (IMHO).