Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFOAMv2306 and scotch library linking #87

Open
aqeelahmed168 opened this issue Jul 26, 2023 · 14 comments
Open

OpenFOAMv2306 and scotch library linking #87

aqeelahmed168 opened this issue Jul 26, 2023 · 14 comments

Comments

@aqeelahmed168
Copy link

Hi,

I tried to compile the OpenFOAM v2306 as the normal process suggested here (https://github.com/mrklein/openfoam-os-x/wiki/OpenFOAM(R)-release-&-Homebrew), without applying any patch.

However, when running decomposePar I get this message:

--> FOAM FATAL ERROR: (openfoam-2306)
Attempted to use <scotch> without the scotchDecomp library loaded.
This message is from the dummy scotchDecomp stub library instead.

Please install <scotch> and ensure libscotch.so is in LD_LIBRARY_PATH.
The scotchDecomp library can then be built from src/parallel/decompose/scotchDecomp.
Dynamically loading or linking this library will add <scotch> as a decomposition method.

Similar process was followed with v10 (with patch) and that has correct linking for this library.

Do you have any suggestion to manually link the libraries (without building new scotch lib)?

@mrklein
Copy link
Owner

mrklein commented Jul 27, 2023

I looks very like empty DYLD_LIBRARY_PATH problem, still I will try to reproduce the error.

Do you have any personal configuration for third party libraries (ex. $HOME/.OpenFOAM/config.sh/scotch file which sets SCOTCH_ARCH_PATH variable)?

@aqeelahmed168
Copy link
Author

No, I do not have any specific configuration.

@mrklein
Copy link
Owner

mrklein commented Jul 28, 2023

Foundation's OpenFOAM and ESI's OpenFOAM have different way of searching for third party libraries. Guess, if you look through the compilation log, you find these lines:

==> skip scotch (no header)
==> skip scotch (no header)

As you said, you do not have any special configuration for scotch, then, guess, your SCOTCH_ARCH_PATH is set to missing third party folder. have_scotch cannot find the header and simply disables this component.

Simple solution would be to create $HOME/.OpenFOAM/config.sh/scotch file with one line:

SCOTCH_VERSION=scotch-system

Setup OpenFOAM environment and run Allwmake script in $FOAM_SRC/parallel/decompose folder.

Maybe it could be proposed as a feature request in ESI's repository to modify have_scotch logic by adding system-wide search as a fall-back even if SCOTCH_VERSION is not scotch-system.

@aqeelahmed168
Copy link
Author

Thanks a lot, issue resolved.

Would be nice to have it as a standard feature though.

@wo315
Copy link

wo315 commented Dec 7, 2023

Thanks a lot, issue resolved.

Would be nice to have it as a standard feature though.

hi, can you give me some information how to fix this problem?

I have the same problem!

Thank you very much!

@mrklein
Copy link
Owner

mrklein commented Dec 8, 2023

Hi,

Could you elaborate? What did not work for you in the message #87 (comment)?

@wo315
Copy link

wo315 commented Dec 9, 2023

Hi,

Could you elaborate? What did not work for you in the message #87 (comment)?

Thank you very much!

I compile the ESI version, OpenFOAM v2306.


  1. Modify the etc/bashrc like this

export WM_COMPILER_TYPE=system
export WM_COMPILER=Gcc
export WM_PRECISION_OPTION=DP
export WM_LABEL_SIZE=32
export WM_COMPILE_OPTION=Debug
export WM_MPLIB=SYSTEMOPENMPI

  1. and then modify etc/config.sh/scotch

SCOTCH_VERSION=scotch-none
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION

  1. compile ./Allwmake -j there also

==> skip scotch (no header)
==> skip scotch (no header)


So, I don't know how to fix this problem!

Can you give me some advices or tips ?

Thank you very much

Yang Wang

@nolankucd
Copy link

nolankucd commented Dec 14, 2023

Editing this comment to add more useful information. After speaking to a colleague who is an OpenFOAM master and also a Mac user I've managed to get scotch to link.

$ brew install scotch

$ brew info scotch

brew info scotch
==> scotch: stable 7.0.4 (bottled), HEAD
Package for graph partitioning, graph clustering, and sparse matrix ordering
https://gitlab.inria.fr/scotch/scotch
/opt/homebrew/Cellar/scotch/7.0.4 (227 files, 11.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-12-15 at 15:32:38
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/s/scotch.rb
License: CECILL-C
==> Dependencies
Build: bison ✘
Required: open-mpi ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 62 (30 days), 169 (90 days), 435 (365 days)
install-on-request: 60 (30 days), 167 (90 days), 432 (365 days)
build-error: 0 (30 days)

Note that scotch is located here:
/opt/homebrew/Cellar/scotch/7.0.4

After you've extracted or cloned OpenFOAM edit etc/config.sh/scotch to include:

export SCOTCH_VERSION=scotch-system
export SCOTCH_ARCH_PATH=/opt/homebrew/Cellar/scotch/7.0.4

then you can build OpenFOAM

@mrklein
Copy link
Owner

mrklein commented Dec 20, 2023

@wo315

  1. and then modify etc/config.sh/scotch

SCOTCH_VERSION=scotch-none export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION

You set SCOTCH_VERSION to scotch-none, so compilation is skipped. You should set it to scotch-system to use system-wide installed Scotch.

Maybe also you should use brew's Scotch instead of custom formula. I made it when Scotch was removed from formulas.

@philipcardiff
Copy link

Thanks @mrklein for this excellent resource.

As a by the way (broadly related to this issue), OpenFOAM.com versions (e.g. v2312) no longer need patches for macOS; however, your guide is still useful regarding installing dependencies with Homebrew and creating a case-sensitive disk image. It might be useful to add a comment on this in the wiki; failing that, at least this thread will help those who search for it.

@mrklein
Copy link
Owner

mrklein commented Jan 23, 2024

@philipcardiff Thank you for the comment. So, the solution would be to remove mention of custom tap and to change formula name to simple scotch (guess, we can remove parmgridgen, do not know if anyone uses it)?

@philipcardiff
Copy link

@philipcardiff Thank you for the comment. So, the solution would be to remove mention of custom tap and to change formula name to simple scotch (guess, we can remove parmgridgen, do not know if anyone uses it)?

@nolankucd 's solution works for me: (i) brew install scotch; (ii) edit etc/config.sh/scotch and set SCOTCH_VERSION and SCOTCH_ARCH_PATH appropriately.

@mrklein
Copy link
Owner

mrklein commented Feb 9, 2024

Updated wiki. Do you think it OK now?

@philipcardiff
Copy link

Updated wiki. Do you think it OK now?

This looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants