for build i use bash on Ubuntu on Windows. I want to use these libraries for my c++ project using extern "C". I have already looked all over the internet and the whole internet, but most of the questions are old and do not work, please help me.
I followed this question: How to install LAPACK for MSVS 2010 on windows?
What am I doing:
mkdir lap
cd lap
git clone https://github.com/Reference-LAPACK/lapack.git
cd lapack
mkdir mybuild
cmake -D BUILD_SHARED_LIBS=ON -D CMAKE_GNUtoMS=ON -S ./ -B ./mybuild
cd mybuild
make
And after assembly there are no dlls, no bin
enter image description here
And in the lib folder there is not even .a or .lib libraries
enter image description here
Please help me to understand.
Related
I want to install the FFTW library in my system which is running on Windows 10. My compiler is minGW GCC 10.1 and I am using Code Blocks.
I have downloaded the 64-bit version fftw-3.3.5-dll64.zip from http://www.fftw.org/install/windows.html and then opened the command window as adminstrator and set my directory to the bin folder of the mingw64 so that I can run dlltool.
However, when I type the command dlltool -d libfftw3-3.def I am getting the error dlltool: Can't open def file: libfftw3-3.def
I guess this is happening because the libfftw3-3.def file is inside the FFTW folder and cannot be seen by the dlltool. Is that right? What should I do?
Actually the reason seems to be rather obvious. As I wrote in my question the files libfftw3-3.def, libfftw3f-3.def and libfftw3l-3.def are located inside the FFTW folder (wherever might that be in your case). I copied an pasted them inside the bin folder of the mingw64 compiler and then executed the following commands:
dlltool -d libfftw3-3.def
dlltool -l libfftw3-3.lib
Then repeated the process for the other two .def files.
So.
Coming from
OpenJPEG installation
The build method maintained by OpenJPEG is CMake.
UNIX/LINUX - MacOS (terminal) - WINDOWS (cygwin, MinGW)
To build the library, type from source tree directory:`
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md
After properly getting Cmake to build, mingw-get to get msys-make (and also msys 1.0) to even have a proper response from MingW64, no matter what I do, I am stuck in the same error.
Downloaded first from the openjpeg-v2.3.1-windowsx64 link which the above proceeding seems to do nothing, as there is no CMakeList file there, then from the 'Source Code' openjpeg-2.3.1 which I can build from but that's it.
Can't make, can't install, can't use.
Considered 'source tree folder' the downloaded folder itself, the src folder inside of it and even a src folder of a IntelliJ project.
What am I missing?
PATH VARIABLE: %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
%IntelliJ IDEA Community Edition%;
C:\Users\Ajna\Desktop\jar2app\jar2app\jar2app_basefiles;
C:\Program Files\CMake\bin;
C:\Program Files\Git\mingw64\bin;
C:\MinGW\bin;
C:\Program Files\ffmpeg-4.2.1-win64-static\bin;
C:\msys\1.0\bin;
I've spent quite a while with this myself today. Here's what worked for me.
Download the whole code folder (green download code button) from
https://github.com/uclouvain/openjpeg
The downloaded folder is called "openjpeg-master". Save it in your downloads folder.
Install MinGW from https://www.ics.uci.edu/~pattis/common/handouts/mingweclipse/mingw.html
Install msys from
https://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download?use_mirror=altushost-swe
Open windows command line.
Navigate to the location of the "openjpeg-master" folder
e.g.
cd C:\#insert_location_of_your_downloads_folder#\Downloads\openjpeg-master
To specify the use of MinGW makefiles on windows use the following command
mkdir build
cd build
cmake -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release
make
The default for cmake on Windows is to use a Visual Studio generator: it generates project files for use with Visual Studio, not makefiles.
If you want it to generate makefiles you have to tell it specifically:
cmake -G 'Unix Makefiles' .. -DCMAKE_BUILD_TYPE=Release
You probably want to file an issue with the project and ask them to update their INSTALL file to have proper instructions.
I want to use gmsh C++ API to develop software.
I can build the project using cmake from source file on Ubuntu and get a executable file "gmsh".
My problem is:
How to compile the program as a shared library?
How to compile C++ API demos with the shared library and run it?
May be it is a stupid problems, but I have trapped here for hours.
Is there any step by step instructions can help me?
Oh, the accepted answer link is wrong! This is the right link.
When you use cmake,you must make sure you set ENABLE_BUILD_DYNAMIC to 1.
Here are my commandline on Windows:
cd gmsh_source_code_dir
mkdir build
cd build
cmake -DENABLE_BUILD_DYNAMIC=1 -DENABLE_FLTK=0 ..
cmake --build . --config Release
cmake --install .
You can find gmsh.lib and gmsh.dll in install directory. Then you can develop your software if you import lib or dll in your project.
The detailed instructions can be found at
https://gitlab.onelab.info/gmsh/gmsh/blob/master/demos/api/README.txt
Last year Boost (from the modular boost git repository) could be built in Windows using these steps.
I got quite far almost a year later, using this recipe:
Install MinGW (32-bits) and Msys (bash etc) using mingw-get-setup
Install the Windows Driver Kit (for W7 I used WDK 7 -- GRMWDK_EN_7600_1.ISO), which provides MASM 8 (needed for boost > 1.51 according to this post)
-downloading the ISO image and extracting the files with WinRAR worked for me
-the installer advises against installing the DSF, so skip that
-add the directories of ML64.exe and ML.exe to the path (both required)
C:\Windows\WinDDK\7600.16385.1\bin\x86\amd64;
C:\Windows\WinDDK\7600.16385.1\bin\x86
Install a 64/32-bit compiler as well (I used TDM gcc 5.1.0-2) and add its bin/ directory to the Windows path
open cmd.exe as administrator and start bash
in the parent dir of boost, run
git clone --recursive https://github.com/boostorg/boost.git boost > clone.log
exit bash, goto directory boost and run:
bootstrap gcc
in project-config.jam, change using msvc ; into using gcc ;
run:
b2 headers (now needed to make symbolic links)
b2 -a -d+2 -q --build-type=complete --build-dir=build toolset=gcc link=shared runtime-link=shared threading=multi
These options to b2 worked with previous versions of boost, but now I can only compile with b2 without options. The full command line returns these errors: undefined reference to __imp_make_fcontext and undefined reference to __imp_jump_fcontext.
I cannot find other posts or even web pages that describe these errors. Does anyone know a way in Windows to still use the b2 options for the latest boost from the GitHub repository?
EDIT:
Using b2 -a -d+2 -q --build-dir=build toolset=gcc works. Apparently the --build-type=complete option is the first of the ones above to break the compilation.
The flags link=shared, runtime-link=shared and threading=multi also cause b2 to stop.
Has anyone got a clue how to solve this? is there a patch for MinGW that works for the current repositories?
Your best bet may be switching to MSYS2 which is a new and improved version of MSYS. I have very good experience with MSYS2 whereas I can't say that about MSYS or Cygwin (In my case that's building a project heavily using boost and c++11).
You can read some comparison here.
Also taken from the answer here:
While MSYS isn't dead, I would say it's not looking very healthy either.
I'm working on a FORTRAN project and I would like to build all of the binaries that I want to maintain on a linux machine that is dedicated for automated builds. I have successfully used mingw to build 32-bit and 64-bit binaries from C source for windows machines on the linux machine with the following packages on Ubuntu.
apt-get install mingw32
apt-get install mingw-w64
Then I run the following commands to actually compile:
gcc -b amd64-mingw32msvc -V 4.4.4 -o <...other options>
However, the mingw packages that I've obtained via apt-get do not include FORTRAN compilers.
Anybody got any ideas on what I can do?
if you got mingw32 and the Gnu C cross compiler is working for you ... when why not just get the Gnu Fortran cross compiler, too?
http://www.nber.org/sys-admin/mingw32-fortran-fedora.html
EXAMPLE apt-get install mingw32-gcc-fortran
I know this is an old thread but a few things seem to have changed and people might still be interested in the topic.
Problem: I want to use my linux machine to compile some code and create a .exe that I can send to people using Windows.
Solution: Essentially here: http ://mxe.cc/
What I did:
Check to see if your system has all the software you need here
run
git clone -b stable https://github.com/mxe/mxe.git
It will download a few small things and create the directory "mxe" (probably in your home folder)
cd into that mxe directory and run "make". HOWEVER: this would take hours and take up a few GB on your hard drive so instead run something like
make mpfr eigen opencsg cgal qt
For more ideas on how to shorten that all see this or the mxe tutorial or somewhere else ;)
The easiest way to compile stuff then seems to be something like:
~/mxe/usr/bin/i686-pc-mingw32-gfortran -c main.f95
~/mxe/usr/bin/i686-pc-mingw32-gfortran main.o -o outfile.exe
Of course you can chose something other than fortran, just consult the mxe/usr/bin to see what its called.
You can always download and install a prebuilt compiler from the MinGW(-w64) project itself:
Windows 64-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/
Windows 32-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/
Just unpack somewhere and add the cross*/bin directory to PATH.
I include (obj)c(++) and fortran.
On Ubuntu 18.04 I use
apt install gfortran-mingw-w64
Then use the compiler x86_64-w64-mingw32-gfortran in place of gfortran. If you're using cmake, you can configure the compiler from the build directory like so:
FC=x86_64-w64-mingw32-gfortran cmake ..