Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Building Fsharp (CentOS) #313

Closed
TonyAbell opened this issue May 30, 2014 · 14 comments
Closed

Building Fsharp (CentOS) #313

TonyAbell opened this issue May 30, 2014 · 14 comments

Comments

@TonyAbell
Copy link

I followed the steps outlined in option 2 here:
http://fsharp.org/use/linux/

git clone https://github.com/mono/mono
 cd mono
 ./autogen.sh --prefix /usr/local
 make get-monolite-latest
 make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
 make
git clone https://github.com/fsharp/fsharp
 cd fsharp
 ./autogen.sh --prefix /usr/local

./autogen.sh --prefix /usr/local
Fsharp build failed because it assumed that mono was installed with a package.
Where I had installed mono using the source code, i.e. make; make install.

I ended up commenting out the package checks in configure.ac

#if ! $PKG_CONFIG --atleast-version=$MONO_REQUIRED_VERSION mono; then
#       AC_MSG_ERROR("You need mono $MONO_REQUIRED_VERSION")
#fi

#if ! $PKG_CONFIG --atleast-version=$MONO_RECOMMENDED_VERSION mono; then
#       AC_MSG_WARN([Mono $MONO_RECOMMENDED_VERSION or higher is recommended, for better GC performance])
#fi

then setting the mono prefix manually

MONOPREFIX="/usr/local"

There should be a command switch which would override the check for the mono package and allow the user to input the mono location.

With the changes above, I am able to generate a the Make files needed to build. However the build fails with the following error:

/root/fsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj (default targets) ->
/usr/local/lib/mono/4.5/Microsoft.Common.targets (GetFrameworkPaths target) ->

        /usr/local/lib/mono/4.5/Microsoft.Common.targets:  warning : TargetFrameworkVersion 'v2.1' not supported by this toolset (ToolsVersion: 4.0).

/root/fsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj (default targets) ->
/usr/local/lib/mono/4.5/Microsoft.Common.targets (GetReferenceAssemblyPaths target) ->

        /usr/local/lib/mono/4.5/Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v2.1'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

         2 Warning(s)
         0 Error(s)

For reference I am using the Linux sandbox provided by Hortonworks
http://hortonworks.com/products/hortonworks-sandbox/#install

Any ideas on what I am doing wrong or how I can fix this build error?

@knocte
Copy link
Contributor

knocte commented May 30, 2014

./autogen.sh --prefix /usr/local
Fsharp build failed because it assumed that mono was installed with a package.

What do you mean with this? did you have mono installed as a package too?

@TonyAbell
Copy link
Author

Sorry I was not more clear.
Mono was installed using the source code
I used the code below

git clone https://github.com/mono/mono
cd mono
./autogen.sh --prefix /usr/local
make get-monolite-latest
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
make
make install

This is the exact error I get...

[root@sandbox fsharp]# ./autogen.sh --prefix /usr/local
checking whether make sets $(MAKE)... yes
checking for pkg-config... /usr/bin/pkg-config
configure: "pkg-config: /usr/bin/pkg-config"
configure: "PKG_CONFIG_LIBDIR: "
configure: error: "You need mono 3.0"
[root@sandbox fsharp]#

@knocte
Copy link
Contributor

knocte commented May 30, 2014

Can you confirm that there's no mono executable in /usr/bin/ ? (If there is, what does /usr/bin/mono --version print?)

@TonyAbell
Copy link
Author

I installed mono on /usr/local/

[root@sandbox fsharp]#  /usr/bin/mono --version
-bash: /usr/bin/mono: No such file or directory

when I check on the version on /usr/local/
I get...

[root@sandbox fsharp]#  /usr/local/bin/mono --version
Mono JIT compiler version 3.4.1 (master/11098d2 Thu May 29 01:08:33 PDT 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen
[root@sandbox fsharp]#

@knocte
Copy link
Contributor

knocte commented May 30, 2014

I know you installed in /usr/local, but you sure you don't have other mono in /usr ?

@rneatherway
Copy link
Member

Have you tried setting PKG_CONFIG_PATH?

@knocte
Copy link
Contributor

knocte commented May 30, 2014

I think most distros include a /usr/local path by default in PKG_CONFIG_PATH, maybe CentOS not? That was going to be my next suggestion after he confirmed that he doesn't have 2 mono installations...

@rneatherway
Copy link
Member

Yes I would have thought so to, but just thought it was worth checking.
On 30 May 2014 23:56, "Andres G. Aragoneses" notifications@github.com
wrote:

I think most distros include a /usr/local path by default in
PKG_CONFIG_PATH, maybe CentOS not? That was going to be my next suggestion
after he confirmed that he doesn't have 2 mono installations...


Reply to this email directly or view it on GitHub
#313 (comment).

@rneatherway
Copy link
Member

Rereading Tony's post I see that he doesn't have a /usr/bin/mono so I don't
think it can be two mono installations.
On 31 May 2014 00:10, "Robin Neatherway" robin.neatherway@gmail.com wrote:

Yes I would have thought so to, but just thought it was worth checking.
On 30 May 2014 23:56, "Andres G. Aragoneses" notifications@github.com
wrote:

I think most distros include a /usr/local path by default in
PKG_CONFIG_PATH, maybe CentOS not? That was going to be my next suggestion
after he confirmed that he doesn't have 2 mono installations...


Reply to this email directly or view it on GitHub
#313 (comment).

@TonyAbell
Copy link
Author

Ok, setting the PKG_CONFIG_PATH worked

[root@sandbox fsharp]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
[root@sandbox fsharp]# echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig

If one is building mono/fsharp from source, there should be a note that the PKG_CONFIG_PATH should be set.

Thanks for you help.

@robstewart57
Copy link

To make this crystal clear, it depends on where the user builds mono, e.g.

$ export PKG_CONFIG_PATH=/path/to/mono-build/lib/pkgconfig/

@caxelrud
Copy link

I am having the same problem. The difference is that I installed mono from source to /usr (so the executables are in /usr/bin). I use:

$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig
$ echo $PKG_CONFIG_PATH
/usr/lib/pkgconfig

I can see the folder /usr/lib/pkgconfig.
But when I use:

$ ./autogen.sh --prefix /usr

The error is exactly the same as presented before this issue:

checking whether make sets $(MAKE)... yes
checking for pkg-config... /usr/bin/pkg-config
configure: "pkg-config: /usr/bin/pkg-config"
configure: "PKG_CONFIG_LIBDIR: "
configure: error: "You need mono 3.0"

@knocte
Copy link
Contributor

knocte commented Feb 21, 2015

$ ./autogen.sh --prefix /usr

Mmm, I've always used "=" instead of a space here: --prefix=/usr. Maybe it's the same but can't hurt to test.

@caxelrud
Copy link

I realized that mono is actually installed at /mono (/root/mono). The error is gone but now I got another error during compilation, so I will open a new issue.

davidpodhola added a commit to davidpodhola/fsfoundation that referenced this issue Mar 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants