在Mac OS X上构建P编译器

时间:2016-10-19 17:41:50

标签: macos p

我在Mac OS X El Capitan 10.11.6上构建Microsoft's P language compiler时遇到问题。

构建日志的相关部分(cd Bld; ./build.sh):

~/workspace/P/Bld
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jlieberm/workspace/P/Bld/build
Scanning dependencies of target Prt
[ 12%] Building C object Prt/CMakeFiles/Prt.dir/API/PrtUser.c.o
In file included from /Users/jlieberm/workspace/P/Src/Prt/API/PrtUser.c:1:
In file included from /Users/jlieberm/workspace/P/Src/Prt/API/PrtUser.h:9:
In file included from /Users/jlieberm/workspace/P/Src/Prt/Core/PrtExecution.h:4:
In file included from /Users/jlieberm/workspace/P/Src/Prt/API/Prt.h:9:
In file included from /Users/jlieberm/workspace/P/Src/Prt/API/PrtProgram.h:14:
/Users/jlieberm/workspace/P/Src/Prt/API/PrtValues.h:255:8: error: unknown type
      name 'PRT_FUN_PARAM_STATUS'
                _In_ PRT_FUN_PARAM_STATUS status,
                     ^
/Users/jlieberm/workspace/P/Src/Prt/API/PrtValues.h:326:8: error: unknown type
      name 'PRT_FUN_PARAM_STATUS'
                _In_ PRT_FUN_PARAM_STATUS status,
                     ^
/Users/jlieberm/workspace/P/Src/Prt/API/PrtValues.h:436:8: error: unknown type
      name 'PRT_FUN_PARAM_STATUS'
                _In_ PRT_FUN_PARAM_STATUS status,
                     ^
In file included from /Users/jlieberm/workspace/P/Src/Prt/API/PrtUser.c:1:
In file included from /Users/jlieberm/workspace/P/Src/Prt/API/PrtUser.h:9:
/Users/jlieberm/workspace/P/Src/Prt/Core/PrtExecution.h:164:122: error: unknown
      type name 'PRT_FUN_PARAM_STATUS'
  ...PRT_MACHINEINST_PRIV * context, _In_ PRT_UINT32 varIndex, _In_ PRT_FUN_P...
                                                                    ^
/Users/jlieberm/workspace/P/Src/Prt/Core/PrtExecution.h:184:8: error: unknown
      type name 'PRT_FUN_PARAM_STATUS'
                _In_ PRT_FUN_PARAM_STATUS status,
                     ^
/Users/jlieberm/workspace/P/Src/Prt/Core/PrtExecution.h:500:8: error: unknown
      type name 'PRT_FUN_PARAM_STATUS'
                _In_ PRT_FUN_PARAM_STATUS       payloadStatus,
                     ^
/Users/jlieberm/workspace/P/Src/Prt/API/PrtUser.c:508:3: error: use of
      undeclared identifier 'PRT_FUN_PARAM_STATUS'
                PRT_FUN_PARAM_STATUS argStatus = va_arg(argp, PRT_FUN_PA...
                ^
7 errors generated.
make[2]: *** [Prt/CMakeFiles/Prt.dir/API/PrtUser.c.o] Error 1
make[1]: *** [Prt/CMakeFiles/Prt.dir/all] Error 2
make: *** [all] Error 2

我使用的是单声道4.6.0 stable和cmake 3.6.2,它符合P build guide for OS X and Linux中的最低要求。

我做错了什么?

1 个答案:

答案 0 :(得分:2)

这是源代码的错误。 P团队未能在PRT_FUN_PARAM_STATUS中包含PrtValues.h枚举声明:

typedef enum PRT_FUN_PARAM_STATUS
{
    PRT_FUN_PARAM_CLONE,
    PRT_FUN_PARAM_SWAP,
    PRT_FUN_PARAM_XFER
} PRT_FUN_PARAM_STATUS;

已修复1fd291c

相关问题