cblas.h: No such file or directory

Issue #29 resolved
Ryan Barnard created an issue

I'm trying to build QCTOOL on a very old system with dependencies installed in non-standard locations. The configure command completes successfully (config.log attached), but compilation fails because cblas.h can't be found (see bottom of issue).

It appears that the compilation command does not add the include directory that BLAS is installed in. Indeed, if I run the command manually, I get the same error message, but if I add -I<PATH_TO_BLAS_INCLUDE>, the compilation completes successfully.

None of the "standard" environment variables seem to have any impact on the include search path.

[316/806] cxx: components/SampleSummaryComponent/src/RiskScoreComputation.cpp -> build/default/components/SampleSummaryComponent/src/RiskScoreComputation_1.o
13:53:19 runner system command -> ['/isilon/wfu_phs/langefeldGrp_new/SOFTWARE/GCC/gcc-4.9.3/bin/g++', '-std=c++11', '-Wall', '-pedantic', '-Wno-long-long', '-Wno-redeclared-class-member', '-Wno-unused-local-typedefs', '-g', '-Idefault/3rd_party/eigen', '-I../3rd_party/eigen', '-Idefault/genfile/include', '-I../genfile/include', '-Idefault/db/include', '-I../db/include', '-Idefault/statfile/include', '-I../statfile/include', '-Idefault/appcontext/include', '-I../appcontext/include', '-Idefault/qcdb/include', '-I../qcdb/include', '-Idefault/metro/include', '-I../metro/include', '-Idefault/3rd_party/boost_1_55_0', '-I../3rd_party/boost_1_55_0', '-Idefault/3rd_party/zstd-1.1.0/lib', '-I../3rd_party/zstd-1.1.0/lib', '-Idefault/3rd_party/sqlite3', '-I../3rd_party/sqlite3', '-Idefault/components/SampleSummaryComponent/include', '-I../components/SampleSummaryComponent/include', '../components/SampleSummaryComponent/src/RiskScoreComputation.cpp', '-c', '-o', 'default/components/SampleSummaryComponent/src/RiskScoreComputation_1.o']
../components/RelatednessComponent/src/PCALoadingComputer.cpp:13:20: fatal error: cblas.h: No such file or directory
  #include "cblas.h"

Comments (9)

  1. Gavin Band repo owner

    Hi, Thanks for this report, I am working on compilation fixes. This is strange because configure step has found cblas as far as I can tell. It would be helpful if you could send me the output of the build step (or, as this can be long currently, perhaps just the part around where the error occurs?) Best, g.

  2. Ryan Barnard reporter

    I've attached a complete build log just in case something earlier in the build presents a clue. The first cblas.h error occurs at line 2374.

  3. Gavin Band repo owner

    Hi Ryan, I'm working on this, if you still have patience for this then two additional things would be helpful please: 1: cat the file build/release/config.hpp (HAVE_CBLAS should be defined in there) 2: cat the output of ./waf-1.5.18 -j 1 -v

    Thanks, g.

  4. Ryan Barnard reporter

    config.hpp:

    /* Configuration header created by Waf - do not edit */
    #ifndef _CONFIG_HPP_WAF
    #define _CONFIG_HPP_WAF
    
    #define HAVE_CBLAS 1
    #define HAVE_LAPACK 1
    #define HAVE_SYS_TIME_H 1
    #define HAVE_GETTIMEOFDAY 1
    #define HAVE_ZLIB 1
    #define HAVE_SQLITE3 1
    #define HAVE_EIGEN 1
    #define HAVE_ZSTD 1
    #define HAVE_DL 1
    #define HAVE_RT 1
    #define HAVE_M 1
    #define HAVE_BZIP2 1
    #define HAVE_MGL 1
    #define HAVE_CAIRO 1
    #define HAVE_PTHREAD 1
    #define HAVE_READLINE 1
    #define HAVE_BOOST_IOSTREAMS 1
    #define HAVE_BOOST_FILESYSTEM 1
    #define HAVE_BOOST_SYSTEM 1
    #define HAVE_BOOST_THREAD 1
    #define HAVE_BOOST_DATE_TIME 1
    #define HAVE_BOOST_UNIT_TEST_FRAMEWORK 1
    #define HAVE_BOOST_TIMER 1
    #define HAVE_BOOST_REGEX 1
    #define HAVE_BOOST_MATH 1
    #define HAVE_BOOST_FUNCTION 1
    #define HAVE_BOOST_SPIRIT 1
    #define BOOST_FILESYSTEM_VERSION 3
    #define GENFILE_USE_FAST_PARSE_METHODS 1
    #define EIGEN_NO_DEBUG 1
    #endif /* _CONFIG_HPP_WAF */
    

    $ ./waf-1.5.18 -j 1 -v:

    Waf: Entering directory `/isilon/wfu_phs/ramongrp/software/build-env/qctool/build'
    [  1/806] qctool_version_autogenerated:  -> build/default/qctool_version_autogenerated.hpp
    11:11:19 runner system command ->  printf '#ifndef QCTOOL_VERSION_HPP
    #define QCTOOL_VERSION_HPP
    namespace globals {
        char const* const qctool_revision = "%s" ;
    }
    #endif
    ' `hg parents --template={node}` > default/qctool_version_autogenerated.hpp
    [  2/806] qctool_version_autogenerated:  -> build/release/qctool_version_autogenerated.hpp
    11:11:19 runner system command ->  printf '#ifndef QCTOOL_VERSION_HPP
    #define QCTOOL_VERSION_HPP
    namespace globals {
        char const* const qctool_revision = "%s" ;
    }
    #endif
    ' `hg parents --template={node}` > release/qctool_version_autogenerated.hpp
    [302/806] cxx: components/RelatednessComponent/src/KinshipCoefficientComputer.cpp -> build/default/components/RelatednessComponent/src/KinshipCoefficientComputer_1.o
    11:11:20 runner system command -> ['/isilon/wfu_phs/langefeldGrp_new/SOFTWARE/GCC/gcc-4.9.3/bin/g++', '-std=c++11', '-Wall', '-pedantic', '-Wno-long-long', '-Wno-redeclared-class-member', '-Wno-unused-local-typedefs', '-g', '-Idefault/3rd_party/eigen', '-I../3rd_party/eigen', '-Idefault/3rd_party/threadpool', '-I../3rd_party/threadpool', '-Idefault/db/include', '-I../db/include', '-Idefault/statfile/include', '-I../statfile/include', '-Idefault/appcontext/include', '-I../appcontext/include', '-Idefault/worker/include', '-I../worker/include', '-Idefault/genfile/include', '-I../genfile/include', '-Idefault/3rd_party/boost_1_55_0', '-I../3rd_party/boost_1_55_0', '-Idefault/3rd_party/sqlite3', '-I../3rd_party/sqlite3', '-Idefault/3rd_party/zstd-1.1.0/lib', '-I../3rd_party/zstd-1.1.0/lib', '-Idefault/components/RelatednessComponent/include', '-I../components/RelatednessComponent/include', '../components/RelatednessComponent/src/KinshipCoefficientComputer.cpp', '-c', '-o', 'default/components/RelatednessComponent/src/KinshipCoefficientComputer_1.o']
    ../components/RelatednessComponent/src/KinshipCoefficientComputer.cpp:18:20: fatal error: cblas.h: No such file or directory
      #include "cblas.h"
                        ^
    compilation terminated.
    Waf: Leaving directory `/isilon/wfu_phs/ramongrp/software/build-env/qctool/build'
    Build failed:  -> task failed (err #1):
        {task: cxx KinshipCoefficientComputer.cpp -> KinshipCoefficientComputer_1.o}
    
  5. Gavin Band repo owner

    I'm confused here because the configure step tries to compile some code including cblas.h and succeeds. How did you tell it the correct include path during the configure step? Using an environment variable, or something else?

  6. Ryan Barnard reporter

    Environment variables. I set LDFLAGS, CXXFLAGS, LIBPATH, and STLIBPATH.

    When I was trying to figure this issue out, it looked like those variables were respected during the configure step but not during the build step.

  7. Gavin Band repo owner

    Hi Ryan, I've made some changes to the build file so that it respects the values of LINKFLAGS (which is used instead of LDFLAGS) and CXXFLAGS. So now these values should be transported to the build environment as well. I've documented this on the wiki. The relevant change is here: cb329e078b06 Hopefully that is enough to get things working for you? Please let me know.

  8. Ryan Barnard reporter

    This change gets the build past the cblas.h error! But a new error arose in the final linkage step: the linker wasn't able to find some of the BLAS-related symbols.

    After a bit of trial-and-error, I found that the link step succeeded if I replaced -lblas with -lopenblas -lgfortran, so I manually edited the default.cache.py and release.cache.py accordingly, and the build succeeded using the waf-1.5.18 script.

    Unless you see a reason why the QCTOOL build system should have recognized openblas+gfortran rather than blas, I consider this issue to be almost certainly an environment problem on my end rather than a QCTOOL problem. So unless you have further comments or questions, feel free to mark this issue as resolved!

    Thanks so much for your time, help, and support!

  9. Gavin Band repo owner

    I'm going to mark this as resolved, we'll leave it at that for now. I can revisit it if it turns out to be a widely encountered issue. g.

  10. Log in to comment