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

CMAKE Shortestpath error for shared declaration #32

Open
piyuveng1 opened this issue Apr 6, 2023 · 14 comments
Open

CMAKE Shortestpath error for shared declaration #32

piyuveng1 opened this issue Apr 6, 2023 · 14 comments

Comments

@piyuveng1
Copy link

My process d getting stuck here don't know how to fix this. Please this help would be greatly appreciated!

$ make install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pv197/tn93/tn93
[ 10%] Built target tn93
[ 21%] Built target tn93-cluster
[ 31%] Built target seqcoverage
[ 34%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/ShortestPathTN93.cpp.o
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp: In function ‘void relaxDistanceEstimates(long unsigned int, long int, char, long int, double)’:
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘left_to_do’ is predetermined ‘shared’ for ‘shared’
#pragma omp parallel for default(none) shared(my_distance_estimate,nodeParents,workingNodes,distanceEstimates, step_penalty, min_overlap, resolutionOption, firstSequenceLength, theSequence, left_to_do)
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘theSequence’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘firstSequenceLength’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘resolutionOption’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘min_overlap’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘step_penalty’ is predetermined ‘shared’ for ‘shared’
make[2]: *** [CMakeFiles/ShortestPathTN93.dir/src/ShortestPathTN93.cpp.o] Error 1
make[1]: *** [CMakeFiles/ShortestPathTN93.dir/all] Error 2
make: *** [all] Error 2

@piyuveng1
Copy link
Author

add_executable(
ShortestPathTN93
src/ShortestPathTN93.cpp
src/stringBuffer.cc
src/tn93_shared.cc
)

add_executable(
selectreads
src/trim_reads.cpp
src/stringBuffer.cc
src/tn93_shared.cc
src/argparse_trim.cpp
)

add_executable(
validate_fasta
src/validate_fasta.cpp
src/stringBuffer.cc
src/tn93_shared.cc
)

add_executable(
fasta_diff
src/fasta_diff.cpp
src/stringBuffer.cc
src/tn93_shared.cc
src/argparse_fasta_diff.cpp
)

if(${OPENMP_FOUND})
add_definitions(${OpenMP_CXX_FLAGS})
target_link_libraries(tn93 PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(tn93-cluster PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(selectreads PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(seqcoverage PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(readreduce PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(fasta_diff PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(ShortestPathTN93 PUBLIC ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
target_link_libraries(seqdiff PRIVATE ${DEFAULT_LIBRARIES} OpenMP::OpenMP_CXX)
endif(${OPENMP_FOUND})

install(
TARGETS ShortestPathTN93
RUNTIME DESTINATION bin
OPTIONAL
)

add_custom_target(TN93SP
DEPENDS ShortestPathTN93
)

install(
TARGETS nucfreqsfasta
RUNTIME DESTINATION bin
OPTIONAL
)

add_custom_target(NF
DEPENDS nucfreqsfasta
)

@piyuveng1
Copy link
Author

my cmakelist.txt with shortestpath references only

@piyuveng1
Copy link
Author

i dont see a shared error conflict if you can see it help me fix this! Please!

@stevenweaver
Copy link
Member

Dear @piyuveng1,

Which compiler and platform are you using?

Best,
Steven

@piyuveng1
Copy link
Author

Dear @piyuveng1,

Which compiler and platform are you using?

Best, Steven

REDhat

@stevenweaver
Copy link
Member

Dear @piyuveng1,

Can you please provide the output of gcc --version

Best,
Steven

@piyuveng1
Copy link
Author

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

@stevenweaver
Copy link
Member

Dear @piyuveng1,

That gcc is really old (4.8 was released over 10 years ago). I'm surprised you are even able to compile since tn93 expects c++14 extensions. Would it be possible to use a later version of gcc via redhat toolset?

Best,
Steven

@piyuveng1
Copy link
Author

[pv197@ip-172-22-160-154 tn93]$ gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

/home/pv197/tn93/src/ShortestPathTN93.cpp: In function ‘void relaxDistanceEstimates(long unsigned int, long int, char, long int, double)’:
/home/pv197/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘step_penalty’ is predetermined ‘shared’ for ‘shared’
#pragma omp parallel for default(none) shared(my_distance_estimate,nodeParents,workingNodes,distanceEstimates, step_penalty, min_overlap, resolutionOption, firstSequenceLength, theSequence, left_to_do)
^
/home/pv197/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘min_overlap’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘resolutionOption’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘firstSequenceLength’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘theSequence’ is predetermined ‘shared’ for ‘shared’
/home/pv197/tn93/src/ShortestPathTN93.cpp:92:208: error: ‘left_to_do’ is predetermined ‘shared’ for ‘shared’
make[2]: *** [CMakeFiles/ShortestPathTN93.dir/build.make:83: CMakeFiles/ShortestPathTN93.dir/src/ShortestPathTN93.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:224: CMakeFiles/ShortestPathTN93.dir/all] Error 2
make: *** [Makefile:150: all] Error 2

Dear @ stevenweaver,

Thank u for taking the time i updated my gcc but still getting the same error.

@ArtPoon
Copy link
Member

ArtPoon commented Apr 10, 2023

did you do a make clean first?

@piyuveng1
Copy link
Author

piyuveng1 commented Apr 18, 2023 via email

@niemasd
Copy link
Contributor

niemasd commented Nov 13, 2023

I'm getting this error using GCC 8.5 on Oracle Linux 8:

[root@codespaces-c478a0 tn93]# make clean
[root@codespaces-c478a0 tn93]# cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: /workspaces/tn93
[root@codespaces-c478a0 tn93]# make
[  2%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/nuc_freqs_from_fasta.cpp.o
[  4%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/stringBuffer.cc.o
[  6%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/tn93_shared.cc.o
[  8%] Linking CXX executable nucfreqsfasta
[  8%] Built target nucfreqsfasta
[ 10%] Building CXX object CMakeFiles/readreduce.dir/src/read_reducer.cpp.o
/workspaces/tn93/src/read_reducer.cpp: In function ‘void handle_a_sequence(StringBuffer&, StringBuffer&, Vector&, Vector&, long int, long int, Vector*)’:
/workspaces/tn93/src/read_reducer.cpp:128:187: error: ‘firstSequenceLength’ is predetermined ‘shared’ for ‘shared’
             #pragma omp parallel for default(none) shared(currently_defined_clusters, try_cluster, sequence_lengths, current_sequence, current_clusters, firstSequenceLength, min_overlap)
                                                                                                                                                                                           ^
/workspaces/tn93/src/read_reducer.cpp:128:187: error: ‘min_overlap’ is predetermined ‘shared’ for ‘shared’
make[2]: *** [CMakeFiles/readreduce.dir/build.make:76: CMakeFiles/readreduce.dir/src/read_reducer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/readreduce.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[root@codespaces-c478a0 tn93]# g++ --version
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18.0.6)

@niemasd
Copy link
Contributor

niemasd commented Nov 13, 2023

The issue I'm running into seems to be in more recent versions of GCC and/or OpenMP. Specifically, it seems like const variables shouldn't be specified in shared(...) clauses based on a Google search. I was able to get past this issue by making the following edits to the tn93 source code:

https://github.com/niemasd/tn93/blob/a00a7c830f71c31b35043d53cddc3e9e0ccf9878/Dockerfile#L7-L8

@niemasd
Copy link
Contributor

niemasd commented Nov 13, 2023

I was able to fix the issue by making the following edits to the tn93 source:

sed -i 's/shared(currently_defined_clusters, try_cluster, sequence_lengths, current_sequence, current_clusters, firstSequenceLength, min_overlap)/shared(currently_defined_clusters, try_cluster, sequence_lengths, current_sequence, current_clusters)/g' src/read_reducer.cpp
sed -i 's/shared(my_distance_estimate,nodeParents,workingNodes,distanceEstimates, step_penalty, min_overlap, resolutionOption, firstSequenceLength, theSequence, left_to_do)/shared(my_distance_estimate,nodeParents,workingNodes,distanceEstimates)/g' src/ShortestPathTN93.cpp

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

4 participants