在尝试编译最新的fsharp代码之前,我已经在我在Linux上运行的RedHat Enterprise 7 Linux发行版上编译并安装了mono-5.0.1。
mono --version
Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Fri Jul 28 08:35:19 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: s390x
Disabled: none
Misc: softdebug
GC: sgen (concurrent by default)
我在/ usr / local中安装了mono。在尝试运行autogen.sh之前,我之前已经导出了以下envars:
export PKG_CONFIG_PATH=/usr/local/mono/lib/pkgconfig/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PKG_CONFIG_LIBDIR=/usr/local/lib/pkgconfig
当我尝试运行autogen.sh时,出现以下错误:
./autogen.sh --prefix=/usr/local
checking whether make sets $(MAKE)... yes
checking for pkg-config... /bin/pkg-config
configure: "pkg-config: /bin/pkg-config"
configure: "PKG_CONFIG_LIBDIR: /usr/local/lib/pkgconfig"
checking for msbuild... no
configure: error: Could not find msbuild
我检查了我得到的mono-5.0.1 tarball的提取,看不到msbuild的引用。无论如何要克服单声道的msbuild的缺乏,以便我可以得到fsharp编译和工作?我有一个更高版本的单声道,所以它应该在那里。非常感谢任何想法或建议。
我尝试按照其中包含msbuild的单声道分支的建议,我收到了以下错误:
# ./cibuild.sh --target Mono
** Using mono from /usr/local/bin/mono
Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Fri Jul 28 08:35:19 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: s390x
Disabled: none
Misc: softdebug
GC: sgen (concurrent by default)
** Downloading MSBUILD from https://github.com/Microsoft/msbuild/releases/download/mono-hosted-msbuild-v0.03/mono_msbuild_d25dd923839404bd64cc63f420e75acf96fc75c4.zip
Installing dotnet cli...
Restoring BuildTools version 1.0.27-prerelease-00927-05...
/home/xxx/Downloads/msbuild-d15.3/init-tools.sh: line 116: /home/xxx/Downloads/msbuild-d15.3/Tools/dotnetcli/dotnet: cannot execute binary file
ERROR: Could not restore build tools correctly. See '/home/xxx/Downloads/msbuild-d15.3/init-tools.log' for more details.
============= /home/xxx/Downloads/msbuild-d15.3/init-tools.log ===========
Running: /home/xxx/Downloads/msbuild-d15.3/init-tools.sh
Installing 'https://dotnetcli.blob.core.windows.net/dotnet/Sdk/1.0.0-preview3-003686/dotnet-dev-rhel-x64.1.0.0-preview3-003686.tar.gz' to '/home/xxx/Downloads/msbuild-d15.3/Tools/dotnetcli/dotnet.tar'
Running: /home/xxx/Downloads/msbuild-d15.3/Tools/dotnetcli/dotnet restore "/home/xxx/Downloads/msbuild-d15.3/Tools/1.0.27-prerelease-00927-05/project.json" --no-cache --packages /home/xxx/Downloads/msbuild-d15.3/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json --legacy-packages-directory
============= end of /home/xxx/Downloads/msbuild-d15.3/init-tools.log ===========
Initializing BuildTools...
/home/xxx/Downloads/msbuild-d15.3/init-tools.sh: line 127: /home/xxx/Downloads/msbuild-d15.3/packages/Microsoft.DotNet.BuildTools/1.0.27-prerelease-00927-05/lib/init-tools.sh: No such file or directory
ERROR: An error occured when trying to initialize the tools. Please check '/home/xxx/Downloads/msbuild-d15.3/init-tools.log' for more details.1
# ls -l /home/xxx/Downloads/msbuild-d15.3/init-tools.log
-rw-r--r--. 1 root root 880 Jul 31 08:16 /home/xxx/Downloads/msbuild-d15.3/init-tools.log
# ls -l /home/xxx/Downloads/msbuild-d15.3/Tools/dotnetcli/dotnet
-rwxr-xr-x. 1 root root 128766 Jun 15 2016 /home/xxx/Downloads/msbuild-d15.3/Tools/dotnetcli/dotnet
正如评论中所建议的那样,我尝试使用Snack中当前存在的Mono-5.2版本,但它们都会因以下错误而失败:
if test -w /home/xxx/Downloads/mono-mono-5.2.0.213/mcs; then :; else chmod -R +w /home/xxx/Downloads/mono-mono-5.2.0.213/mcs; fi
cd /home/xxx/Downloads/mono-mono-5.2.0.213/mcs && make --no-print-directory -s NO_DIR_CHECK=1 PROFILES='binary_reference_assemblies net_4_x xbuild_12 xbuild_14 ' CC='gcc' all-profiles
mkdir -p -- build/deps
/usr/local/bin/mcs: line 2: /usr/local/bin/mono: No such file or directory
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
*** Downloading bootstrap required 'monolite/1050200001'
--2017-08-01 08:03:09-- https://download.mono-project.com/monolite/monolite-1050200001-latest.tar.gz
Resolving download.mono-project.com (download.mono-project.com)... 72.21.81.200, 2606:2800:11f:17a5:191a:18d5:537:22f9
Connecting to download.mono-project.com (download.mono-project.com)|72.21.81.200|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4740059 (4.5M) [application/x-gzip]
Saving to: ‘STDOUT’
0K .......... .......... .......... .......... .......... 1% 4.34M 1s
... <removed extra lines>
... <removed extra lines>
4600K .......... .......... ........ 100% 7.54M=0.6s
2017-08-01 08:03:10 (7.54 MB/s) - written to stdout [4740059/4740059]
*** The runtime 'mono' doesn't appear to be usable.
*** Trying the 'monolite/1050200001' directory.
Creating .dep_dirs-basic...
mkdir -p -- ../../class/lib/basic/
make[8]: *** No rule to make target `../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ContentType.cs', needed by `../../class/lib/basic/mscorlib.dll'. Stop.
make[7]: *** [do-all] Error 2
make[6]: *** [all-recursive] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [profile-do--basic--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/home/xxx/Downloads/mono-mono-5.2.0.213/runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/xxx/Downloads/mono-mono-5.2.0.213'
make: *** [all] Error 2