RJVB/afsctool

Building on Apple M1

Closed this issue · 5 comments

The CritSectEx library doesn't compile on ARM architecture.

RJVB commented
RJVB commented

Can you pull and try again please. Hopefully the fix was easier than I thought.

I get the following compiler output:

~/co/afsctool/build$ make
Scanning dependencies of target PP
[  9%] Building CXX object CMakeFiles/PP.dir/src/utils.cpp.o
[ 18%] Building CXX object CMakeFiles/PP.dir/src/ParallelProcess.cpp.o
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
In file included from /Users/mborch/co/afsctool/src/Thread/Thread.hpp:14:
In file included from /Users/mborch/co/afsctool/src/CritSectEx/CritSectEx.h:43:
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:697:8: error: use of undeclared identifier '_InterlockedIncrement'
                if( !_InterlockedIncrement(atomic) ){
                     ^
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:698:4: error: use of undeclared identifier 'YieldProcessor'; did you mean
      'FileProcessor'?
                        YieldProcessor();
                        ^
/Users/mborch/co/afsctool/src/fsctool.h:98:7: note: 'FileProcessor' declared here
class FileProcessor;
      ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
In file included from /Users/mborch/co/afsctool/src/Thread/Thread.hpp:14:
In file included from /Users/mborch/co/afsctool/src/CritSectEx/CritSectEx.h:43:
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:711:8: error: use of undeclared identifier '_InterlockedDecrement'; did you
      mean '_InterlockedSetTrue'?
                        if( _InterlockedDecrement(atomic) ){
                            ^~~~~~~~~~~~~~~~~~~~~
                            _InterlockedSetTrue
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:694:20: note: '_InterlockedSetTrue' declared here
static inline void _InterlockedSetTrue( volatile long *atomic )
                   ^
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:711:8: error: value of type 'void' is not contextually convertible to 'bool'
                        if( _InterlockedDecrement(atomic) ){
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:712:5: error: use of undeclared identifier 'YieldProcessor'; did you mean
      'FileProcessor'?
                                YieldProcessor();
                                ^
/Users/mborch/co/afsctool/src/fsctool.h:98:7: note: 'FileProcessor' declared here
class FileProcessor;
      ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
In file included from /Users/mborch/co/afsctool/src/Thread/Thread.hpp:14:
In file included from /Users/mborch/co/afsctool/src/CritSectEx/CritSectEx.h:43:
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:716:8: error: use of undeclared identifier '_InterlockedIncrement'
                        if( _InterlockedIncrement(atomic) ){
                            ^
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:717:5: error: use of undeclared identifier 'YieldProcessor'; did you mean
      'FileProcessor'?
                                YieldProcessor();
                                ^
/Users/mborch/co/afsctool/src/fsctool.h:98:7: note: 'FileProcessor' declared here
class FileProcessor;
      ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
/Users/mborch/co/afsctool/src/Thread/Thread.hpp:384:6: error: no matching function for call to '_InterlockedSetTrue'
                                        _InterlockedSetTrue(isNotified);
                                        ^~~~~~~~~~~~~~~~~~~
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:694:20: note: candidate function not viable: no known conversion from 'long'
      to 'volatile long *' for 1st argument; take the address of the argument with &
static inline void _InterlockedSetTrue( volatile long *atomic )
                   ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
/Users/mborch/co/afsctool/src/Thread/Thread.hpp:395:7: error: no matching function for call to '_InterlockedSetTrue'
                                                _InterlockedSetTrue(isLocked);
                                                ^~~~~~~~~~~~~~~~~~~
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:694:20: note: candidate function not viable: no known conversion from 'long'
      to 'volatile long *' for 1st argument; take the address of the argument with &
static inline void _InterlockedSetTrue( volatile long *atomic )
                   ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
/Users/mborch/co/afsctool/src/Thread/Thread.hpp:401:9: error: no matching function for call to '_InterlockedSetTrue'
                                                                _InterlockedSetTrue(isLocked);
                                                                ^~~~~~~~~~~~~~~~~~~
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:694:20: note: candidate function not viable: no known conversion from 'long'
      to 'volatile long *' for 1st argument; take the address of the argument with &
static inline void _InterlockedSetTrue( volatile long *atomic )
                   ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
/Users/mborch/co/afsctool/src/Thread/Thread.hpp:402:9: error: use of undeclared identifier 'YieldProcessor'; did you mean
      'FileProcessor'?
                                                                YieldProcessor();
                                                                ^
/Users/mborch/co/afsctool/src/fsctool.h:98:7: note: 'FileProcessor' declared here
class FileProcessor;
      ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
/Users/mborch/co/afsctool/src/Thread/Thread.hpp:412:7: error: no matching function for call to '_InterlockedSetFalse'
                                                _InterlockedSetFalse(isLocked);
                                                ^~~~~~~~~~~~~~~~~~~~
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:707:20: note: candidate function not viable: no known conversion from 'long'
      to 'volatile long *' for 1st argument; take the address of the argument with &
static inline void _InterlockedSetFalse( volatile long *atomic )
                   ^
In file included from /Users/mborch/co/afsctool/src/ParallelProcess.cpp:20:
In file included from /Users/mborch/co/afsctool/src/ParallelProcess_p.hpp:19:
/Users/mborch/co/afsctool/src/Thread/Thread.hpp:414:7: error: no matching function for call to '_InterlockedSetFalse'
                                                _InterlockedSetFalse(isNotified);
                                                ^~~~~~~~~~~~~~~~~~~~
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:707:20: note: candidate function not viable: no known conversion from 'long'
      to 'volatile long *' for 1st argument; take the address of the argument with &
static inline void _InterlockedSetFalse( volatile long *atomic )
                   ^
/Users/mborch/co/afsctool/src/ParallelProcess.cpp:395:4: error: use of undeclared identifier '_InterlockedIncrement'
                        _InterlockedIncrement(&PP->nProcessing);
                        ^
/Users/mborch/co/afsctool/src/ParallelProcess.cpp:397:4: error: use of undeclared identifier '_InterlockedDecrement'; did you
      mean '_InterlockedSetTrue'?
                        _InterlockedDecrement(&PP->nProcessing);
                        ^~~~~~~~~~~~~~~~~~~~~
                        _InterlockedSetTrue
/Users/mborch/co/afsctool/src/CritSectEx/msemul.h:694:20: note: '_InterlockedSetTrue' declared here
static inline void _InterlockedSetTrue( volatile long *atomic )
                   ^
/Users/mborch/co/afsctool/src/ParallelProcess.cpp:398:4: error: use of undeclared identifier '_InterlockedIncrement'
                        _InterlockedIncrement(&PP->nProcessed);
                        ^
16 errors generated.
make[2]: *** [CMakeFiles/PP.dir/src/ParallelProcess.cpp.o] Error 1
make[1]: *** [CMakeFiles/PP.dir/all] Error 2
make: *** [all] Err
RJVB commented

Bummer, my bad.

Pull and try again, please? (There may be a link error on a _yield() function which is supposed to be a compiler intrinsic from what I understood).

Works – amazing work.