Comments (28)
The compilation of GALAHAD on Mac works with gcc/gfortran
.
from galahad.
What version of gcc?
from galahad.
It was gcc 11.1.
from galahad.
https://stackoverflow.com/a/33401294
from galahad.
The SOMP = -fopenmp compiler flag should provide all the relevant include data here. Could you please go to the $GALAHAD/src/ssids directory, and try
make -f (architecture)
where (architecture) is whatever name you have in $GALAHAD/makefiles/ (e.g., mac64.osx.gfo). This will tell us what flags are being passed
from galahad.
I have an error when I try make -f binarybuilder.bb.fc
:
sandbox:${WORKSPACE}/srcdir/GALAHAD/src/ssids # make -f binarybuilder.bb.fc
make: binarybuilder.bb.fc: No such file or directory
make: *** No rule to make target 'binarybuilder.bb.fc'. Stop.
sandbox:${WORKSPACE}/srcdir/GALAHAD/src/ssids # ls
C config.h fkeep.F90 gpu_subtree_no_cuda.f90 solve.cu
LICENCE contrib.f90 gpu inform.f90 ssids.f90
NumericSubtree.cxx contrib.h gpu_alloc.f90 ldlt_app.cxx ssidss.data
README contrib_free.f90 gpu_datatypes.f90 ldlt_nopiv.cxx ssidss.f90
SymbolicSubtree.cxx cpu gpu_dense_factor.f90 ldlt_tpp.cxx subtree.f90
ThreadStats.cxx cpu_iface.f90 gpu_factor.f90 makemaster syrk.cu
akeep.f90 cpu_solve.f90 gpu_interfaces.f90 profile.cxx updata_ssids
anal.f90 cpu_subtree.f90 gpu_smalloc.f90 profile.hxx wrappers.cxx
assemble.cu datatypes.f90 gpu_solve.f90 profile_iface.f90
cholesky.cxx dense_factor.cu gpu_subtree.f90 reorder.cu
sandbox:${WORKSPACE}/srcdir/GALAHAD/src/ssids #
from galahad.
from galahad.
sandbox:${WORKSPACE}/srcdir/GALAHAD/src/ssids # make -f $GALAHAD/makefiles/binarybuilder.bb.fc
Compiling guess_topology mkdir -p /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/hw_topology
sed -f /workspace/srcdir/GALAHAD/seds/have_hwloc_def.sed ../spral/config.h > /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/config1.h
sed -f /workspace/srcdir/GALAHAD/seds/have_getcpu_undef.sed /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/config1.h > /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/config.h
cp ../spral/compat.hxx /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/
cp ../spral/guess_topology.cxx /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/
cp ../spral/guess_topology.hxx /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/hw_topology/
cp ../spral/hwloc_wrapper.hxx /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/hw_topology/
cd /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double ; c++ -I. -o guess_topology.o -c -std=c++11 -fPIC -O2 -fopenmp \
guess_topology.cxx \
|| ( printf ' %-26s' "=> Disabling optimization " ; \
c++ -I. -o guess_topology.o -c -std=c++11 -fPIC -O0 -fopenmp \
guess_topology.cxx )
guess_topology.cxx:13:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
=> Disabling optimization guess_topology.cxx:13:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
make: *** [/workspace/srcdir/GALAHAD/src/ssids/makemaster:310: /workspace/srcdir/GALAHAD/objects/binarybuilder.bb.fc/double/libgalahad_spral.a(guess_topology.o)] Error 1
from galahad.
from galahad.
Yes, cc
and c++
are alias for C and C++ compilers.
It's gcc and g++ for Linux / Windows and Clang / Clang++ on Mac and FreeBSD.
from galahad.
could you try gcc/gfortran for macOS?
from galahad.
Yes, I restart the compilation.
I just checked and we use gcc/gfortran
for SPRAL:
https://github.com/JuliaPackaging/Yggdrasil/blob/master/S/SPRAL/build_tarballs.jl#L16-L19
@jfowkes
Do you test the compilation of SPRAL on Mac with CI?
It seems that modifications are needed for Clang / Clang++ compilers (native compilers on Mac / FreeBSD).
from galahad.
I would suggest that we forget about clang for now, and first stabilize everything with gcc/gfortran on every platform of interest.
from galahad.
I believe that Alexis mentioned the work-around here. If
c++ is from clang, one needs SOMP = '-fopenmp=libomp'
in the compiler.binarybuilder.bb.fc file in archdefs, which
is copied into GALAHAD's makefiles/binarybuilder.bb.fc
on installation. Give that a try ... but I agree with Dominique that
we should concentrate on gcc for the time being.
from galahad.
@amontoison SPRAL is only tested on Linux GCC in the CI but I have successfully compiled it with Homebrew GCC on Mac.
I believe it would take quite a bit of nontrivial work to make SPRAL work with Clang given how complex it is.
from galahad.
I tried flang/clang, and the flag
SOMP = -fopenmp=libomp -I/usr/lib/llvm-14/lib/clang/14.0.0/include
did the trick here ... but as you see it needs to know where the system header is. The alternative
-I/usr/lib/gcc/x86_64-linux-gnu/11/include/omp.h
also worked, and is marginally more portable.
Unfortunately, a following ssids compile
clang++ -I. -o NumericSubtree.o -c -std=c++11 -fPIC -O -fopenmp=libomp -I/usr/lib/llvm-14/lib/clang/14.0.0/include NumericSubtree.cxx
produces a wave of errors, typically
./ssids/cpu/kernels/assemble.hxx:212:42: error: variable 'add_a_blk_sz' must have explicitly specified data sharing attributes
add_a_block(iblk, std::min(iblk+add_a_blk_sz,snode.num_a), node, aval, scaling);
As I don't know c++, I have no idea what this means, and I can't find any compiler flag to disable it (if that is even possible). This does not happen with icx which is also built on top of LLVM, so I suspect it is just clang being too fussy.
from galahad.
from galahad.
Very interesting. In the block
#pragma omp taskgroup
for(int iblk=0; iblk<snode.num_a; iblk+=add_a_blk_sz) {
#pragma omp task default(none) \
firstprivate(iblk) \
shared(snode, node, aval, scaling, ldl)
add_a_block(iblk, std::min(iblk+add_a_blk_sz,snode.num_a), node, aval, scaling);
}
what precisely would you remove? I'm willing to try, but need hand holding
from galahad.
If my understanding is correct then removing the default(none)
after #pragma omp task
should fix it.
from galahad.
I'll try tomorrow once I "get back" from Edinburgh
from galahad.
Ok, so the issue is in spral
and not in GALAHAD
. We could move the issue to the GitHub SPRAL repository directly.
I agree with Dominique, we should compile GALAHAD with gcc/gfortran
on all relevant platforms.
@jfowkes I did two CI scripts for a C++ code a few months ago, you can easily adapt them for SPRAL:
https://github.com/bbopt/nomad/blob/master/.github/workflows/ci.yml
https://github.com/bbopt/nomad/blob/master/.cirrus.yml
from galahad.
Thanks @amontoison, I've created a SPRAL pull request to test with Clang/Flang:
ralna/spral#97
Flang doesn't seem to be working though, any suggestions? We should discuss there.
from galahad.
Good call, Jari. removing the three default (none)s fixed the compiler errors, and the sls exhaustive test now runs ... and ssids gives the right answer. I should add that this is with flang/clang as compiled from https://github.com/flang-compiler/llvm.git . Next I need to make sure that these changes don't ruin ssids under other compilers. Progress on an otherwise hopeless day!
from galahad.
Oh, I should add that I needed to set the galahad variables
OPENMP = -fopenmp -lstdc++ -lhwloc
SOMP = -fopenmp=libomp -I/usr/lib/llvm-14/lib/clang/14.0.0/include
and the other is of course not portable (but presumably will be when flang is finally
released as part of clang
from galahad.
OK, the updates also work for gcc and icc. icx fails, but I think it did before. Jari, are you planning to make these changes in spral as well?
from galahad.
@nimgould yes I will make these changes to SPRAL, could you point me to the three default(none) statements you removed?
from galahad.
Yes, in assemble.hxx (as per $GALAHAD/src/ssids/cpu/kernel/), lines 209, 281 and 389
from galahad.
@nimgould done, fixed in SPRAL.
from galahad.
Related Issues (20)
- scu_initialize is not implemented in the C interface of SCU HOT 10
- all builds now fail as blas/lapack are now modern (.f90) rather than traditional (*.f)
- [documentation] Explain how we can compile static libraries with Meson
- Improve tests for SLLS
- Register GALAHAD.jl HOT 1
- Compile GALAHAD_jll.jl with HSL_jll.jl HOT 1
- GALAHAD is unable to use PASTIX / SPM HOT 3
- Name of the libraries when GALAHAD is compiled with 64-bit integer HOT 3
- TagBot trigger issue HOT 2
- [CI] Install C Regex Library on Windows HOT 4
- [CI] Check modules failing HOT 11
- [CI] Cirrus CI Julia install fails
- MKL-Pardiso with 64-bit integer
- Clong has been replaced by int64_t in the HSL headers HOT 23
- added gkregex for Windows issue HOT 19
- Python solve routines should allow keyword arguments HOT 9
- [C Interface] Garbled NLS subproblem_inform HOT 2
- Should we remove GALAHAD/src/external/hsl/hsl_metis? HOT 1
- Precompiled libraries
- Add a routine to return the version number of GALAHAD HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from galahad.