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

Compiling on cluster #15

Open
lsuhpchelp opened this issue Apr 24, 2017 · 7 comments
Open

Compiling on cluster #15

lsuhpchelp opened this issue Apr 24, 2017 · 7 comments

Comments

@lsuhpchelp
Copy link

I'm following the installation instructions from the Manual v1 (released 4/4/2917) 3 Installation, "Command-line versions of TreeScaper can be generated by following these instructions" (Step (1), (2)...., and now at the last step (Step 6: (6) Now, in Terminal type “make” to compile Treescaper.
)
I wish to compile the Command-line versions of TreeScaper
from the source code by g++ (tried Intel compiler as well), but following error appears:
g++ CLVmain.cpp -w randgen.cpp wstring.cpp warray.cpp wmapping.cpp wmix.cpp wfile.cpp wimport_form.cpp wDimEst.cpp wNLDR.cpp Trees.cpp TreeOPE.cpp Sparse_matrix.cpp greedy_louvain.cpp graph.cpp slicer.cpp label-map.cc community.cpp info.cpp hashfunc.cc hash.cc hungarian.c ClusterForest.cpp ClusterInstance.cpp Forest.cpp rspr.cpp SiblingPair.cpp SPRLCA.cpp SPRNode.cpp UndoMachine.cpp /home/gmount/clapack-3.2.1-CMAKE/lapack_LINUX.a /home/gmount/clapack-3.2.1-CMAKE/blas_LINUX.a /home/gmount/clapack-3.2.1-CMAKE/F2CLIBS/libf2c.a -lm -I/home/gmount/clapack-3.2.1-CMAKE/INCLUDE -DCOMMAND_LINE_VERSION -o CLVTreeScaper

In file included from CLVmain.cpp:38:0:
wDimEst.h:57:5: error: ‘DimEst::DimEst(String, String, String, String)’ cannot be overloaded
In file included from CLVmain.cpp:38:0:
wDimEst.h:48:5: error: with ‘DimEst::DimEst(String, String, String, String)’
In file included from wDimEst.cpp:26:0:
wDimEst.h:57:5: error: ‘DimEst::DimEst(String, String, String, String)’ cannot be overloaded
In file included from wDimEst.cpp:26:0:
wDimEst.h:48:5: error: with ‘DimEst::DimEst(String, String, String, String)’

If Intel compiler is used, the error is basically the same:
icpc CLVmain.cpp -w randgen.cpp wstring.cpp warray.cpp wmapping.cpp wmix.cpp wfile.cpp wimport_form.cpp wDimEst.cpp wNLDR.cpp Trees.cpp TreeOPE.cpp Sparse_matrix.cpp greedy_louvain.cpp graph.cpp slicer.cpp label-map.cc community.cpp info.cpp hashfunc.cc hash.cc hungarian.c ClusterForest.cpp ClusterInstance.cpp Forest.cpp rspr.cpp SiblingPair.cpp SPRLCA.cpp SPRNode.cpp UndoMachine.cpp /home/ychen64/clapack-3.2.1-CMAKE/lapack_LINUX.a /home/ychen64/clapack-3.2.1-CMAKE/blas_LINUX.a /home/ychen64/clapack-3.2.1-CMAKE/F2CLIBS/libf2c.a -lm -I/home/ychen64/clapack-3.2.1-CMAKE/INCLUDE -DCOMMAND_LINE_VERSION -o CLVTreeScaper

wDimEst.h(57): error: invalid redeclaration of member function "DimEst::DimEst(String, String, String, String)" (declared at line 48)
DimEst(String filename, String meth, String dataform, String para_fname)
^
wDimEst.h(57): error: invalid redeclaration of member function "DimEst::DimEst(String, String, String, String)" (declared at line 48)
DimEst(String filename, String meth, String dataform, String para_fname)
^

We are using Linux RHEL6. Could you help? Thanks,

@lsuhpchelp
Copy link
Author

One more question, if installing from the source code, do I still need glic 2.14 or above version during the installation and later use? I appreciate your time for reply.

@whuang08
Copy link
Owner

whuang08 commented Apr 29, 2017

The problem is due to the undefined macro "COMMAND_LINE_VERSION". Lines 48 to 62 in wDimEst.h
are

#ifdef COMMAND_LINE_VERSION
DimEst(String filename, String meth, String dataform, String para_fname)
{
initial_DimEst(filename, meth, dataform, para_fname);
}
void initial_DimEst(String filename, String meth, String dataform, String para_fname);
void init_parameters(String para_filename);
#else
DimEst(String filename, String meth, String dataform, String para_fname)
{
double **dist = NULL;
initial_DimEst(filename, dist, 0, 0, meth, dataform, para_fname);
};
#endif

which means that if macro COMMAND_LINE_VERSION is define, then compile the first part of the code. Otherwise, compile the second part. The error complains the line 57 which is the second part. This does not make sense since in comment line version, the second part should not be compiled.

In g++, option -DCOMMAND_LINE_VERSION defines the COMMAND_LINE_VERSION, (see the Makefile for details.) However, it seems that intel compiler does not recognize the option.

An easy way to solve the problem is to un-comment the line 24 in wdef.h. It would be nice to figure out how to define a macro-object as an option of Intel compiler. Let me know if the problem is solved.

@lsuhpchelp
Copy link
Author

Thanks for your reply.
The default line 24 wdef.h is:
#define _MAC //_MAC // COMMAND_LINE_VERSION //_WINDOWS //_LINUX //
I replaced _MAC with COMMAND_LINE_VERSION according to the manual, and got the overload error in the make step described in my first thread.
So by default, this line is not a comment line. I am not sure how to "un-comment the line 24 in wdef.h", and could you please explain it? Thanks again.

@whuang08
Copy link
Owner

whuang08 commented May 1, 2017

I believe the version you have is out of date. Please download the source code by clicking "Clone or download" under the Code tab. Also make sure you choose master branch, which is the default one.

The 24th line of wdef.h should be:
//#define COMMAND_LINE_VERSION

Best,
Wen

@lsuhpchelp
Copy link
Author

Hi Wen,
Thanks for the new source code, I used gcc 4.7.2 to compile it and at first it gives the following error:
Trees.cpp:2485:25: error: #if with no expression
Trees.cpp:2881:25: error: #if with no expression
Trees.cpp:3601:25: error: #if with no expression
Trees.cpp: In member function ‘void Trees::Compute_Bipart_Covariance()’:
Trees.cpp:4017:5: error: ‘QProgressDialog’ was not declared in this scope
Trees.cpp:4017:21: error: expected ‘;’ before ‘dlg’
Trees.cpp:4018:5: error: ‘dlg’ was not declared in this scope
Trees.cpp:4019:27: error: ‘Qt’ has not been declared
Trees.cpp: In member function ‘bool Trees::Compute_RF_dist_by_hash(bool)’:
Trees.cpp:4105:5: error: ‘QProgressDialog’ was not declared in this scope
Trees.cpp:4105:21: error: expected ‘;’ before ‘dlg’
Trees.cpp:4112:9: error: ‘dlg’ was not declared in this scope
Trees.cpp:4113:31: error: ‘Qt’ has not been declared
Trees.cpp:4205:9: error: ‘dlg’ was not declared in this scope
Trees.cpp:4206:31: error: ‘Qt’ has not been declared
Trees.cpp:4358:5: error: ‘dlg’ was not declared in this scope
Trees.cpp: In member function ‘bool Trees::Compute_Matching_dist()’:
Trees.cpp:4429:5: error: ‘QProgressDialog’ was not declared in this scope
Trees.cpp:4429:21: error: expected ‘;’ before ‘dlg’
Trees.cpp:4430:5: error: ‘dlg’ was not declared in this scope
Trees.cpp:4431:27: error: ‘Qt’ has not been declared
Trees.cpp: In member function ‘bool Trees::Compute_SPR_dist()’:
Trees.cpp:4547:5: error: ‘QProgressDialog’ was not declared in this scope
Trees.cpp:4547:21: error: expected ‘;’ before ‘dlg’
Trees.cpp:4548:5: error: ‘dlg’ was not declared in this scope
Trees.cpp:4549:27: error: ‘Qt’ has not been declared
make: *** [CLVTreeScaper] Error 1
So based on the error message, I changed "#if" to "#ifdef" on the respective lines in Trees.cpp and no error occurred and a CLVTreeScaper binary generated. I took a look at the lib link info of this binary.
[ychen64@mike5 TreeScaper-master]$ ldd CLVTreeScaper
linux-vdso.so.1 => (0x00007fffa9b4d000)
libstdc++.so.6 => /usr/local/compilers/GNU/gcc-4.7.2/lib64/libstdc++.so.6 (0x00002ab33148c000)
libm.so.6 => /lib64/libm.so.6 (0x0000003d44000000)
libgcc_s.so.1 => /usr/local/compilers/GNU/gcc-4.7.2/lib64/libgcc_s.so.1 (0x00002ab3317ad000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d43400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d43000000)
I am not sure if my change of "#if" and the lib link info make sense to you, so could you please let me know the compilation is good or not?
Thanks!
Yuwu

@whuang08
Copy link
Owner

whuang08 commented May 8, 2017

Thank you. It is a problem and the code does not work on all compilers. We fixed it in the new version.

Wen

@lsuhpchelp
Copy link
Author

Great to know that.
Thanks for your effort on the improvement of this software.
Wish you all the best,
Yuwu

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

2 participants