czimaginginstitute / AreTomo3

Live processing and real time reconstruction of cryo
BSD 3-Clause "New" or "Revised" License
17 stars 1 forks source link

Trouble compiling #3

Open shahpnmlab opened 5 months ago

shahpnmlab commented 5 months ago

Hi Shawn, Trying to compile this version but running into the following error messages

In file included from MaUtil/CParseArgs.cpp:1:0:
MaUtil/CMaUtilInc.h:4:20: error: expected '{' before '::' token
 namespace McAreTomo::MaUtil
                    ^
MaUtil/CMaUtilInc.h:4:20: error: 'MaUtil' in namespace '::' does not name a type
MaUtil/CMaUtilInc.h:475:27: error: 'MaUtil' is not a namespace-name
 namespace MU = McAreTomo::MaUtil;
                           ^
MaUtil/CMaUtilInc.h:475:33: error: expected namespace-name before ';' token
 namespace MU = McAreTomo::MaUtil;
                                 ^
MaUtil/CParseArgs.cpp:9:28: error: 'MaUtil' is not a namespace-name
 using namespace McAreTomo::MaUtil;
                            ^
MaUtil/CParseArgs.cpp:9:34: error: expected namespace-name before ';' token
 using namespace McAreTomo::MaUtil;
                                  ^
MaUtil/CParseArgs.cpp:11:1: error: 'CParseArgs' does not name a type
 CParseArgs::CParseArgs(void)
 ^
MaUtil/CParseArgs.cpp:15:1: error: 'CParseArgs' does not name a type
 CParseArgs::~CParseArgs(void)
 ^
MaUtil/CParseArgs.cpp:19:6: error: 'CParseArgs' has not been declared
 void CParseArgs::Set(int argc, char* argv[])
      ^
MaUtil/CParseArgs.cpp: In function 'void McAreTomo::Set(int, char**)':
MaUtil/CParseArgs.cpp:21:2: error: 'm_argc' was not declared in this scope
  m_argc = argc;
  ^
MaUtil/CParseArgs.cpp:22:2: error: 'm_argv' was not declared in this scope
  m_argv = argv;
  ^
MaUtil/CParseArgs.cpp: At global scope:
MaUtil/CParseArgs.cpp:25:6: error: 'CParseArgs' has not been declared
 bool CParseArgs::FindVals(const char* pcTag, int aiRange[2])
      ^
MaUtil/CParseArgs.cpp: In function 'bool McAreTomo::FindVals(const char*, int*)':
MaUtil/CParseArgs.cpp:29:17: error: 'm_argc' was not declared in this scope
  for(int i=1; i<m_argc; i++)
                 ^
MaUtil/CParseArgs.cpp:30:18: error: 'm_argv' was not declared in this scope
  { if(strcasecmp(m_argv[i], pcTag) != 0) continue;
                  ^
MaUtil/CParseArgs.cpp:37:26: error: 'm_argc' was not declared in this scope
  for(int i=aiRange[0]; i<m_argc; i++)
                          ^
MaUtil/CParseArgs.cpp:38:17: error: 'm_argv' was not declared in this scope
  { char* argv = m_argv[i];
                 ^
MaUtil/CParseArgs.cpp: At global scope:
MaUtil/CParseArgs.cpp:54:6: error: 'CParseArgs' has not been declared
 void CParseArgs::GetVals(int aiRange[2], float* pfVals)
      ^
MaUtil/CParseArgs.cpp: In function 'void McAreTomo::GetVals(int*, float*)':
MaUtil/CParseArgs.cpp:61:11: error: 'm_argc' was not declared in this scope
   if(j >= m_argc) return;
           ^
MaUtil/CParseArgs.cpp:62:10: error: 'm_argv' was not declared in this scope
   sscanf(m_argv[j], "%f", pfVals + i);
          ^
MaUtil/CParseArgs.cpp: At global scope:
MaUtil/CParseArgs.cpp:66:6: error: 'CParseArgs' has not been declared
 void CParseArgs::GetVals(int aiRange[2], int* piVals)
      ^
MaUtil/CParseArgs.cpp: In function 'void McAreTomo::GetVals(int*, int*)':
MaUtil/CParseArgs.cpp:75:11: error: 'm_argc' was not declared in this scope
   if(j >= m_argc) return;
           ^
MaUtil/CParseArgs.cpp:77:17: error: 'm_argv' was not declared in this scope
   strcpy(acBuf, m_argv[j]);
                 ^
MaUtil/CParseArgs.cpp: At global scope:
MaUtil/CParseArgs.cpp:88:6: error: 'CParseArgs' has not been declared
 void CParseArgs::GetVals(int aiRange[2], char** ppcVals)
      ^
MaUtil/CParseArgs.cpp: In function 'void McAreTomo::GetVals(int*, char**)':
MaUtil/CParseArgs.cpp:95:11: error: 'm_argc' was not declared in this scope
   if(j >= m_argc) return;
           ^
MaUtil/CParseArgs.cpp:96:22: error: 'm_argv' was not declared in this scope
   strcpy(ppcVals[i], m_argv[j]);
                      ^
MaUtil/CParseArgs.cpp: At global scope:
MaUtil/CParseArgs.cpp:100:6: error: 'CParseArgs' has not been declared
 void CParseArgs::GetVal(int iArg, char* pcVal)
      ^
MaUtil/CParseArgs.cpp: In function 'void McAreTomo::GetVal(int, char*)':
MaUtil/CParseArgs.cpp:102:26: error: 'm_argc' was not declared in this scope
  if(iArg <= 0 || iArg >= m_argc) return;
                          ^
MaUtil/CParseArgs.cpp:103:16: error: 'm_argv' was not declared in this scope
  strcpy(pcVal, m_argv[iArg]);
                ^
MaUtil/CParseArgs.cpp: At global scope:
MaUtil/CParseArgs.cpp:104:1: error: expected '}' at end of input
 }
 ^
make: *** [MaUtil/CParseArgs.o] Error 1

I am using make version GNU Make 3.82 Built for x86_64-redhat-linux-gnu

and my compilation command is

make exe -f makefile [CUDAHOME=/path/to/CUDA/12.0.0]
szhengczii commented 5 months ago

I am using g++ (GCC) 8.5.0 (Red Hat 8.5.0-18), GNU Make 4.2.1 Built for x86_64-redhat-linux-gnu.

totalcos commented 3 weeks ago

Compiling on Ubuntu 22.04, gcc 11.4, make 4.3 and CUDA 11.8, I could not get it to work until I added the "-Xcompiler -no-pie" flags to the "exe:" part of makefile11.

szhengczii commented 2 weeks ago

This issue is caused by the pre-compiled library files. You need to recompile them. They are Mrcfile and Util in LibSrc. Run make clean followed by make all in each folder. Then recompile AreTomo3.

rdrighetto commented 2 days ago

Just came here to thank @totalcos for the solution proposed. Also worked for me under