Comments (13)
The quad interface is a subroutine so the correct program is:
program test
Use scifor
Implicit None
real(8) :: Integral
call quad(sin2, 0.0d0, pi, result=integral)
Write (,) Integral
! ------------------------------- !
Contains
Function sin2(x)
Real(8) :: sin2
Real(8) :: x
sin2 = sin(x)**2
End Function sin2
end Program test
$ mpif90 $(pkg-config --cflags --libs scifor) test.f90
$ ./a.out
1.5707963097588762
Cheers,
A
from scifortran.
Thank you!
When I used the compile command (pkg-config --cflags --libs scifor) test.f95
, it returned -bash: -I/home/wangy/opt/scifor/gnu/4.6.31/include: No such file or directory
to me.
However, when I input gfortran test.f95 -I/home/wangy/opt/scifor/gnu/4.6.31/include -L/home/wangy/opt/scifor/gnu/4.6.31/lib -lscifor /usr/lib64/liblapack.so /usr/lib64/libblas.so
,
it returned me ./a.out
.
Why did I fail to use $(pkg-config --cflags --libs scifor) test.f95
?
from scifortran.
from scifortran.
According to your advice, I follow instructions printed after the make post-install. But there is another issue shown below.
Why is there a \;
in /usr/lib64/liblapack.so\;/usr/lib64/libblas.so
? I think the \;
leads to the gfortran error. How to address it?
from scifortran.
This looks like the pkg-config configuration file for SCIFOR is corrupted.
pkg-config report informations about linking (and other) directives for any installed library in the system. This is done by reading suitable configuration files specific to each library. Each such file is provided together with the library and placed in specific system directories, where pkg-config can find and read, as stored in the environment variable PKG_CONFIG_PATH. The file have the form <library_name>.pc
Together with SCIFOR we thus provide a scifor.pc file, which is created by Cmake during post-install step. To avoid getting access to system directory we place such file in your home under ~/.pkgconfig.d. This directory is then added to the PKG_CONFIG_PATH by one of the method listed after
In some cases (depending on the Linux distro) this file scifor.pc comes out corrupted. You need to fix it by removing the ;;/usr/lib64/libblas.so and replacing it with a space. There should be only one reference to lapack and one to blas.
Note that this string is generated by a CMake macro that we use to search Lapack/Blas library.
This should solve your problem.
Cheers,
A
from scifortran.
So how to remove the ;;/usr/lib64/libblas.so?
from scifortran.
from scifortran.
Thank you so much!
from scifortran.
string is generated by a CMake macro
It seems that issue could be resolved by placing
STRING(REPLACE ";" " " LAPACK_LIBRARIES ${LAPACK_LIBRARIES})
into cmake/BuildPkgConfigFile.cmake before IF statements. And I need to check if this replacement works as I has described issue in my system.
LAPACK_LIBRARIES returns paths to /usr/lib64/lapack.so;/usr/lib64/blas.so
by cmake for lapack implementation installed in my case. Additional path from BLAS_LIBRARIES string just add one blas library /usr/lib64/blas.so
path if available and doesn't cause problem.
But I didn't check if this replacement affects other cmake files later.
from scifortran.
I see.
Thanks for pointing this out. I'll try to implement this in a separate branch. Should this works as expected we can integrate it in the stable version.
from scifortran.
I will update my gentoo package (not ready yet) for scifortran and will make additionally tests with some example that uses blas.
At least for 4.7.4 with example for newton() (no blas of couse) there was no ld errors with double blas library linked.
from scifortran.
Packaging for Linux distro would be a very welcome upgrade. Please let us know and thanks for trying.
from scifortran.
STRING(REPLACE ";" " " LAPACK_LIBRARIES ${LAPACK_LIBRARIES})
It should be (quoted last variable)
STRING(REPLACE ";" " " LAPACK_LIBRARIES "${LAPACK_LIBRARIES}")
otherwise ";" will be replaced with empty string.
I update my patch with some more common cases (remove duplicates) but need to scifor with lapack related example.
from scifortran.
Related Issues (20)
- Documentation HOT 5
- Are there some fortran exmaples used to show how to use ```SciFortran```? HOT 8
- Issues about ```cmake ..``` HOT 6
- Another issue with failed to compile with ```mpif90 $(pkg-config --cflags --libs scifor) test.f95``` HOT 1
- Issues about FFT HOT 4
- Does SciFortran offer an interface of K-D tree? HOT 1
- Error applying patch zdotc.patch HOT 9
- Incompatibility of mentioned Licenses HOT 3
- Windows 10 Installation
- compilation not working on ubuntu 20.04.2 HOT 3
- A few questions about SciFortran and it's packaging HOT 3
- typos "platoforms" HOT 1
- We should better define the min versions of `CMake` and `ninja` HOT 8
- We state that MPI is optional but `-DUSE_MPI=false` fails HOT 3
- What should I do with this cmake error? HOT 2
- A problem in making the GAUSS_QUADRATURE.f90.o HOT 2
- Add support for dynamic lib and tests with CMake HOT 2
- Segfault when using system-provided lapack HOT 3
- New DEBUG fflags break back-compatibility with GCC 8.3.0 HOT 5
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 scifortran.