Open HuynhThienPhai opened 1 year ago
You need to install xxd, e.g. https://www.codingninjas.com/studio/library/xxd-linux
I followed your suggestion. After running the make command, the end of the output is shown below
$ make
'rm' -f STAR.o Parameters.o
g++ -c -O3 -std=c++11 -fopenmp -D'COMPILATION_TIME_PLACE="2023-08-23T05:04:54+01:00 :/home/huynhtp/software/STAR/source"' -D'GIT_BRANCH_COMMIT_DIFF="On branch master ; commit 79affaae7d5e70221287762eab4e40679fad87f7 ; diff files: "' -pipe -Wall -Wextra STAR.cpp
STAR.cpp: In function ‘void usage(int)’:
STAR.cpp:52:45: error: ‘parametersDefault’ was not declared in this scope
52 | cout.write(reinterpret_cast<char *>(parametersDefault),
| ^~~~~
STAR.cpp:53:20: error: ‘parametersDefault_len’ was not declared in this scope
53 | parametersDefault_len);
| ^~~~~
make: *** [Makefile:100: STAR.o] Error 1
Not sure, I have not seen such an issue before. If compilation does not work, you can use pre-compiled executables.
I am getting the same output as HuynhTheinPhai
I fixed it with the following:
The typical use of xxd in build processes like this is to generate a C header file from some binary data. The errors you're seeing imply that either this step didn't happen, didn't happen correctly, or the generated header is not being included or used in your compilation.
Manual Generation: As a test, you can try manually running the xxd command that's supposed to generate the parametersDefault.xxd file, similar to:
xxd -i parametersDefault > parametersDefault.xxd
Ensure this command is run in the correct directory where parametersDefault exists.
So for alpine I included the package xxd from vim and now it works until I get a new error:
In file included from SharedMemory.cpp:5:
SharedMemory.h:142:27: error: expected ')' before 'key'
142 | SharedMemory(key_t key, bool unloadLast);
| ~ ^~~~
| )
SharedMemory.h:160:9: error: 'key_t' does not name a type
160 | key_t _key;
| ^~~~~
SharedMemory.h:161:9: error: 'key_t' does not name a type
161 | key_t _counterKey;
| ^~~~~
SharedMemory.cpp:22:1: error: no declaration matches 'SharedMemory::SharedMemory(key_t, bool)'
22 | SharedMemory::SharedMemory(key_t key, bool unloadLast): _key(key), _counterKey(key+1), _unloadLast(unloadLast), _err(&cerr)
| ^~~~~~~~~~~~
SharedMemory.h:85:7: note: candidates are: 'constexpr SharedMemory::SharedMemory(const SharedMemory&)'
85 | class SharedMemory
| ^~~~~~~~~~~~
SharedMemory.h:85:7: note: 'SharedMemory::SharedMemory()'
SharedMemory.h:85:7: note: 'class SharedMemory' defined here
SharedMemory.cpp: In member function 'std::string SharedMemory::GetPosixObjectKey()':
SharedMemory.cpp:90:19: error: '_key' was not declared in this scope; did you mean 'key'?
90 | key << "/" << _key;
| ^~~~
| key
SharedMemory.cpp: In member function 'std::string SharedMemory::CounterName()':
SharedMemory.cpp:97:45: error: '_key' was not declared in this scope
97 | counterName << "/shared_use_counter" << _key;
| ^~~~
SharedMemory.cpp: In member function 'void SharedMemory::CreateAndInitSharedObject(size_t)':
SharedMemory.cpp:109:19: error: '_key' was not declared in this scope
109 | _shmID=shmget(_key, toReserve, IPC_CREAT | IPC_EXCL | SHM_NORESERVE | 0666); // _shmID = shmget(shmKey, shmSize, IPC_CREAT | SHM_NORESERVE | SHM_HUGETLB | 0666);
| ^~~~
SharedMemory.cpp: In member function 'void SharedMemory::OpenIfExists()':
SharedMemory.cpp:141:23: error: '_key' was not declared in this scope
141 | _shmID=shmget(_key,0,0);
| ^~~~
SharedMemory.cpp: In member function 'void SharedMemory::EnsureCounter()':
SharedMemory.cpp:247:33: error: '_counterKey' was not declared in this scope; did you mean '_counterMem'?
247 | _sharedCounterID=shmget(_counterKey,0,0);
| ^~~~~~~~~~~
| _counterMem
SharedMemory.cpp:254:33: error: '_counterKey' was not declared in this scope; did you mean '_counterMem'?
254 | _sharedCounterID=shmget(_counterKey, 1, IPC_CREAT | IPC_EXCL | SHM_NORESERVE | 0666);
| ^~~~~~~~~~~
| _counterMem
make: *** [Makefile:100: SharedMemory.o] Error 1
I downloaded STAR by wget, but I have a problem when running "make" (The scripts run on Debian12).
the results are the following: $ make xxd -i parametersDefault > parametersDefault.xxd /bin/sh: 1: xxd: not found Makefile:138: Depend.list: No such file or directory make: *** [Makefile:152: parametersDefault.xxd] Error 127
Thank you in advance.