Tuesday, September 20, 2011

Build FSL-4.1.8 from source code.

!!ERROR in BUILD!!
  Could not make the following projects successfully:
    fabber possum

Look into the log file and see if I can fix this two packages.

Error for building fabber tool:

Making project src/fabber

/bin/rm -f /tmp/fslgrot *.o *.a *.exe core depend.mk
/bin/rm -f /tmp/fslgrot fabber mvntool
/home/yingying/opt/fsl_4_1_8/config/common/rules.mk:320: depend.mk: No such file or directory
Building dependency file depend.mk
c++ -Wall -ansi -pedantic -Wno-long-long    -m64 -ggdb -I/home/yingying/opt/fsl_4_1_8/extras/include/newmat -I/home/yingying/opt/fsl_4_1_8/extras/include/libprob -I/home/yingying/opt/fsl_4_1_8/extras/include/boost -I. -I/home/yingying/opt/fsl_4_1_8/include -I/home/yingying/opt/fsl_4_1_8/include   -c -o fwdmodel_flobs.o fwdmodel_flobs.cc
c++ -Wall -ansi -pedantic -Wno-long-long    -m64 -ggdb -I/home/yingying/opt/fsl_4_1_8/extras/include/newmat -I/home/yingying/opt/fsl_4_1_8/extras/include/libprob -I/home/yingying/opt/fsl_4_1_8/extras/include/boost -I. -I/home/yingying/opt/fsl_4_1_8/include -I/home/yingying/opt/fsl_4_1_8/include   -c -o tools.o tools.cc
tools.cc: In member function ‘virtual double DescendingZeroFinder::FindZero() const’:
tools.cc:126: error: ‘numeric_limits’ was not declared in this scope
tools.cc:126: error: expected primary-expression before ‘double’
tools.cc:126: error: expected ‘)’ before ‘double’
tools.cc:126: error: expected ‘)’ before ‘;’ token
make: *** [tools.o] Error 1

Solution to this:

add the line:

#include 
beneath #include "easylog.h" in ${FSLDIR}/src/fabber/tools.cc and then restart the compilation.

Error for building possum:

Making project src/possum

/bin/rm -f /tmp/fslgrot *.o *.a *.exe core depend.mk
/bin/rm -f /tmp/fslgrot possum spharm_rm signal2image pulse systemnoise possum_sum b0calc b0sim test_possum
/home/yingying/opt/fsl_4_1_8/config/common/rules.mk:320: depend.mk: No such file or directory
Building dependency file depend.mk
c++ -Wall -ansi -pedantic -Wno-long-long    -m64 -O3 -fexpensive-optimizations -m64 -I/home/yingying/opt/fsl_4_1_8/extras/include/newmat -I/home/yingying/opt/fsl_4_1_8/extras/include/libprob -I/home/yingying/opt/fsl_4_1_8/extras/include -I. -I/home/yingying/opt/fsl_4_1_8/include -I/home/yingying/opt/fsl_4_1_8/include   -c -o possum.o possum.cc
In file included from possum.cc:84:
possumfns.h:16: error: conflicting declaration ‘const double b0’
possumfns.h:14: error: ‘b0’ has a previous declaration as ‘const double* b0’
possumfns.h:16: error: conflicting declaration ‘const double b0gxx’
possumfns.h:14: error: ‘b0gxx’ has a previous declaration as ‘const double* b0gxx’
possumfns.h:16: error: conflicting declaration ‘const double b0gyy’
possumfns.h:14: error: ‘b0gyy’ has a previous declaration as ‘const double* b0gyy’
possumfns.h:16: error: conflicting declaration ‘const double b0gzz’
possumfns.h:14: error: ‘b0gzz’ has a previous declaration as ‘const double* b0gzz’
possum.cc: In function ‘int compute_volume(int, char**)’:
possum.cc:907: error: cannot convert ‘double’ to ‘const double*’ for argument ‘17’ to ‘void voxel4(double, double, double, const NEWMAT::RowVector&, const NEWMAT::Matrix&, int, int, double, double, double, const double*, const double*, const double*, const double*, const double*, int, const double*, const double*, int, std::string, const double*, double, double, int, double, double, int, int, int, double*, double*)’
make: *** [possum.o] Error 1

Solution to this:


modify the line in ${FSLDIR}/src/possum/possumfns.h which is currently: 

void voxel4(const double x,const double y,const double z, 
            const RowVector& tissue,const Matrix& H,const int nreadp,const int v,
            const double xdim,const double ydim,const double zdim,
            const double* b0, const double* b0gxx,const double* b0gyy,const double* b0gzz,
            const double* b0timecourse,const int Nb0,
            const double b0, const double b0gxx,const double b0gyy,const double b0gzz, 
            const double* timecourse,const double* activation,const int Nact,
     const string outputname, const double* table_slcprof, const double dslcp, const double dslcp_first, const int Nslc,
            const double den,const double RFtrans, const int opt_test,
            const int nospeedup,
            const int save_kcoord,
            double* sreal, double* simag);

 to:

void voxel4(const double x,const double y,const double z, 
            const RowVector& tissue,const Matrix& H,const int nreadp,const int v,
            const double xdim,const double ydim,const double zdim,
     const double* b0time, const double* b0xtime,const double* b0ytime,const double* b0ztime,
            const double* b0timecourse,const int Nb0,
     const double b0, const double b0x,const double b0y,const double b0z, 
            const double* timecourse,const double* activation,const int Nact,
     const string outputname, const double* table_slcprof, const double dslcp, const double dslcp_first, const int Nslc,
            const double den,const double RFtrans, const int opt_test,
            const int nospeedup,
            const int save_kcoord,
            double* sreal, double* simag);


Find which Debian or ubuntu Linux Version you are running

Solution 1
cat /etc/issue
The file /etc/issue holds the version of Ubuntu installed on your system
Solution 2
lsb_release -a
or
cat /etc/lsb-release

 

4 comments:

  1. YEAH, building successfully. It works much better than the Debian FSL package. COOL.

    ReplyDelete
  2. In the solution to the fabber bug, you just say to add the line "#include" with no library to include. Doing this still results in an error and it being unable to build fabber. Is there a library name missing on this writeup?

    Edit: Ah, found the solution on the FSL mailing list. was interpreted as an html tag even though it was in a pre block so it doesn't show up as text.

    ReplyDelete
  3. limits rather since html interpreted it as a tag in my comment also.

    ReplyDelete
  4. Thanks for the solution!
    FYI for anyone else using this, for fabber, the addition is "#include "

    ReplyDelete