lisitsyn / tapkee

A flexible and efficient С++ template library for dimension reduction
http://tapkee.lisitsyn.me
BSD 3-Clause "New" or "Revised" License
231 stars 58 forks source link

OpenMP: Add missing shared variable specifications #51

Closed ypnos closed 5 years ago

ypnos commented 5 years ago

Because of the strict default(none), all variables that are used within parallel context need be specified.

Fixes compile errors with g++ (GCC) 9.1.0.

lisitsyn commented 5 years ago

Thanks for the patch!

I see that Ubuntu build fails:

/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp: In function ‘tapkee::DenseSymmetricMatrix tapkee::tapkee_internal::compute_shortest_distances_matrix(RandomAccessIterator, RandomAccessIterator, tapkee::tapkee_internal::Neighbors&, DistanceCallback)’:
/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp:53:101: error: ‘n_neighbors’ is predetermined ‘shared’ for ‘shared’
/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp:53:101: error: ‘N’ is predetermined ‘shared’ for ‘shared’
/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp: In function ‘tapkee::DenseMatrix tapkee::tapkee_internal::compute_shortest_distances_matrix(RandomAccessIterator, RandomAccessIterator, tapkee::tapkee_internal::Landmarks&, tapkee::tapkee_internal::Neighbors&, DistanceCallback)’:
/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp:172:43: error: ‘n_neighbors’ is predetermined ‘shared’ for ‘shared’
/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp:172:43: error: ‘N_landmarks’ is predetermined ‘shared’ for ‘shared’
/home/vsts/work/1/s/include/tapkee/routines/isomap.hpp:172:43: error: ‘N’ is predetermined ‘shared’ for ‘shared’

I guess this is due to some older version of a compiler there..

ypnos commented 5 years ago

I don't even understand what that is supposed to mean. A different option would be to remove the default(none).

lisitsyn commented 5 years ago

Can you try without default(none)? I think this thing was some kind of defensive to avoid sharing.

ypnos commented 5 years ago

See #52