Load F# Source File - f#

How can I load another F# source file (*.fs) into a project? The #load "path/to/file" preprocessor directive only works if the file you're working from is an F# script file or F# interactive.
I think it may have to do with a makefile, am I correct?
EDIT: Also, I'm not using any IDE; just Emacs, and Mono.

If you're compiling manually at the command line, you must list all the files you want the F# compiler to use, in order.
Otherwise, the .NET equivalent to a makefile is MSBuild, and the Mono version of MSBuild is XBuild.

Related

Coverity support issue for Borland C++Builder

When I compile my code using Borland C++Builder (it is necessary for me to use only the Borland compiler), bcc32.exe is able to compile the code successfully. When I build this same code with the cov-build command inside of cmd.exe, the build fails with errors like:
cannot open source file "iostream"
What is the possible reason behind this, and how do I debug it?
Here is the code
Coverity requires that you configure your compiler in the same environment that you build it in. If you fail to do so, the configuration probes will not pick up your include paths, amongst other things.

Deploying F# exe

I have an F# program I built in VS2013. I am intending to deploy this on a windows 2008 R2 server with .NET framework 4.5 installed. Now, when I build the program in visual studio, it creates an exe in the debug/bin directory (MyProgram.exe). Do I need to include a copy of fharp.core.dll with the exe? Or, will the build process automatically compile the necessary dependancy DLLs (fsharp.core, fsharp.data, fsharp.data.TypeProviders)? Most of the research I can search online for seems to look at VS2010 and I am not using fsc,exe currently.
Thanks for any insight provided.
You can use the compiler option --standalone to statically links the FSharp.Core.dll (F# runtime) and any reference assemblies that depend on it (i.e. any other F# assemblies).
You may or may not need to copy FSharp.Core.dll together with the .exe.
If F# is already installed on the server, you may not need it, but it has to be the correct version of F#.
Otherwise, the F# license allows you to deploy FSharp.Core.dll together with your own binaries.
There's also the 'official' FSharp.Core NuGet package, if that's more to your liking.

Compiling project with NIFs with rebar: cl.exe not found

I'm new to erlang and rebar. In my rebar project I used a dependency containing native c code and during rebar compile I'm getting error:
Name cl.exe is not recognized as an internal or external command, operable program or batch file
I guess that rebar is trying to compile c files from my dependency using Microsoft's cl.exe compiler from VisualStudio, right? The problem is that I don't have VS installed and don't want to install it.
Why rebar is trying to use cl.exe? Can I configure rebar to use different compiler to compile c files?
According to the comments in the rebar port compiler code, you can provide an alternative C compiler by adding something like this to your rebar.config:
{port_env, [{"CC", "/path/to/gcc.exe"}]}.
You will most likely have to change the CFLAGS to match the compiler. To compile NIFs and ports the OTP headers and development libraries must be compiled and available.

Building DEB package for fsharp compiler

I would like to install the fsharp compiler from Github on my Debian system, and the usual way would be to create a deb package first and then install it (so it is possible to uninstall it later, etc.). What is the easiest way to achieve this? All the examples of how to use dh_make assume you have a source tar.gz appropriately named, whereas I don't. Also I need to use some prefix for the autogen script:
./autogen.sh --prefix=/usr
I am not sure it this makes the task any more difficult.
This should actually be fairly simple to achieve with a binary package - which will also be cross-platform because the F# compiler itself is written in F#. The compiler itself is fairly standalone and depends only on a few BCL libraries. There are versions that run on Mono.
More important than installing the compiler is the integration with your platform's build system(s). Microsoft ships a Microsoft.FSharp.targets file for MSBuild, I don't know whether that will work with Mono's xBuild.
I have put together a blog post that explains where to find the various bits that make up the F# compiler and how to package them to compile on a platform that has only .NET and MSBuild (AppHarbor in my case), which you may find helpful.

Compiling z3 ocaml binding in linux

I am trying to compile the OCaml binding for z3 in Linux.
I tried using the provided Makefile: I did "make ocamlrelease" but it aborts with the error
cp: cannot stat `ml_release/build-lib.sh': No such file or directory
I also read the included readme.txt in the ml directory and it says to use SLAM and SDT, but these seem to work only in Windows, not Linux.
How can I compile the OCaml binding?
Thanks,
José
We are currently working on this issue. It should be fixed soon. Right now, the ML bindings available at http://z3.codeplex.com do not work. There are some broken references and Windows only dependencies. This will be fixed.

Resources