Skip to content

Commit

Permalink
Fix/win builds (#107)
Browse files Browse the repository at this point in the history
* First pass at Windows build CI.  -MW

* Fix path to source directory. -MW

* Make cmake happy about sh.exe in path. -MW

* Switch to make for final build. -MW

* Actually, stick with cmake. -MW

* Drop support for mingw32.  -MW

* Attempt to add atirfacts. -MW

* Package the dll and exe files. -MW

* Get the artifacts path correct. -MW

* Zip everything into one file. -MW

* Fix typo.  -MW

* Correct 7z PATH?? -MW

* Update the documentation.  -MW
  • Loading branch information
matthewware committed Mar 19, 2020
1 parent 37fb04b commit 8429a91
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 44 deletions.
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
C/C++ Driver for the BBN APSv2
===============================
[![Build Status](https://travis-ci.com/BBN-Q/libaps2.svg?branch=master)](https://travis-ci.com/BBN-Q/libaps2)
[![Build status](https://ci.appveyor.com/api/projects/status/96bjuekewvan9xry?svg=true)](https://ci.appveyor.com/project/caryan/libaps2)
[![Build status](https://ci.appveyor.com/api/projects/status/lac52m1815be9a19?svg=true)](https://ci.appveyor.com/project/matthewware/libaps2)

This repository provides the C++ (with a C calling API) driver for controlling the second generation [BBN Arbitrary Pulse Sequencer](https://www.raytheon.com/sites/default/files/capabilities/rtnwcm/groups/public/documents/content/aps-datasheet.pdf). In addition to the C driver we provide thin wrappers for Matlab and Julia.

Expand Down Expand Up @@ -35,18 +35,7 @@ We get the [asio](http://think-async.com/Asio) dependency via a submodule we nee

#### Visual Studio

We have built libaps2 with Visual Studio 2015 using the
"CMake VS 2015 C, C++, IVF 16" version. In PowerShell with git available create
the `version.hpp` file: ``cat .\src\lib\version_template.hpp | % {$_ -replace
"<TOKEN>", "$(git describe --dirty)"} | Set-Content .\src\lib\version.hpp``.
Then in the "VS2015 x64 Native Tools" command prompt

```cmd
md build
cd build
cmake -G "Visual Studio 14 2015 Win64" ..\src
cmake --build . --config Release
```
We currently only support Windows builds in MinGW. It is possible to build the library and utilities in Visual Studio though this process tends to be brittle.

#### MSYS2 and MinGW-w64

Expand Down Expand Up @@ -75,6 +64,9 @@ The most painless way to use gcc on Windows has been using
Tested on:
* Windows 10 Professional with gcc 6.1.0

For the adventurous, the Appveyor build artifacts are available for download
[here](https://ci.appveyor.com/api/projects/matthewware/libaps2/artifacts/build/Release.zip). These are binaries build from the master branch.

### Linux
Use your distribution's package manager to install the dependencies and it should work out of the box.

Expand All @@ -83,7 +75,7 @@ Tested on:

### OS X
1. Install the command-line developer tools.
2. Use [Homebrew](http://brew.sh/) to install cmake.
2. Use [Homebrew](http://brew.sh/) to install cmake.
3. Then a standard ``cmake ../src`` and ``make`` should build.

Tested on:
Expand Down
27 changes: 22 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ skip_tags: true
skip_non_tags: false

# Build worker image (VM template)
image: Visual Studio 2015
environment:
matrix:
- generator: "MinGW Makefiles"
dialect: mingw-w64

# scripts that are called at very beginning, before repo cloning
init:
Expand All @@ -19,7 +22,7 @@ matrix:
platform:
- x64
configuration:
- Release
- Debug

# scripts that run after cloning repository
install:
Expand All @@ -30,28 +33,42 @@ build: off

# scripts to run before build
before_build:
# Workaround for CMake not wanting sh.exe on PATH for MinGW
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- if "%dialect%"=="mingw-w64" set PATH=c:\msys64\mingw64\bin;%PATH%

# scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services)
before_package:

# scripts to run after build
after_build:
- 7z a Release.zip c:\projects\libaps2\build\libaps2.dll
- 7z a Release.zip c:\projects\libaps2\build\*.exe

# to run your custom scripts instead of automatic MSBuild
build_script:
# create build directory and call cmake
- md build
- cd build
- cmake -G "Visual Studio 14 2015 Win64" ..\src
- cmake --build . --config %configuration%
- cmake -H. -G"%generator%" -DCMAKE_BUILD_TYPE=%configuration% ../src/
- if "%generator:~0,5%"=="MinGW" set CMAKE_BUILD_FLAGS=-- -j
- cmake --build . %CMAKE_BUILD_FLAGS%


# artifacts configuration
artifacts:

# pushing entire folder as a zip archive
- path: build\Release
# - path: 'build\*.dll'
# name: build\Libray.zip
# type: Auto
#
# - path: 'build\*.exe'
# name: build\Utils.zip
# type: Auto

- path: build\Release.zip
name: Release
#
# # Deploy to GitHub Releases
# - provider: GitHub
Expand Down
55 changes: 30 additions & 25 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,6 @@ Using git has the advantage that users may easily upgrade to future libaps2
releases with ``git pull``. Description of the source repository files is
available in the :ref:`file-list` section.

Installation via conda
~~~~~~~~~~~~~~~~~~~~~~

Users of the Anaconda python distribution can install libaps2 via
``conda``::

conda install -c bbn-q libaps2

This command will install the libaps2 shared library and libaps2 python wrapper
into your Anaconda path (``~/anaconda3/lib`` on posix-systems, or
``C:\Users\%USERNAME%\Anaconda3\Library`` on windows) such that it can be easily
loaded by other programs. To verify that it worked, launch an ipython REPL and
try::

In [1]: import aps2

If that command runs without errors, the install completed successfully. If you
encounter errors, verify that the Anaconda library folder is on your PATH.

Installation from source
~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -108,7 +89,31 @@ corresponding to your operating system and extract the files. On posix-systems,
copy the contents of the archive to corresponding locations in ``/usr/local``
(i.e. copy files from ``lib/`` to ``/usr/local/lib`` and ``include/`` to
``/usr/local/include``). On windows, add the ``bin`` folder to the PATH
variable, or copy ``libaps2.dll`` to ``C:\windows\system32``.
variable, or copy ``libaps2.dll`` to ``C:\windows\system32``. Build artifacts
from Appveyor are also available for download (https://ci.appveyor.com/api/projects/matthewware/libaps2/artifacts/build/Release.zip). These are built
from the latest master branch code.

Installation via conda
~~~~~~~~~~~~~~~~~~~~~~
.. danger::
**DEPRECATION WARNING**: this install process is no longer supported.
Please build the library from source or download the preexisting binaries.

Users of the Anaconda python distribution can install libaps2 via
``conda``::

conda install -c bbn-q libaps2

This command will install the libaps2 shared library and libaps2 python wrapper
into your Anaconda path (``~/anaconda3/lib`` on posix-systems, or
``C:\Users\%USERNAME%\Anaconda3\Library`` on windows) such that it can be easily
loaded by other programs. To verify that it worked, launch an ipython REPL and
try::

In [1]: import aps2

If that command runs without errors, the install completed successfully. If you
encounter errors, verify that the Anaconda library folder is on your PATH.

.. _file-list:

Expand Down Expand Up @@ -222,8 +227,8 @@ interfaces using the `ip` command::
A more permanent solution would involve editing the network interfaces file,
e.g. ``/etc/network/interfaces``.

In centOS this location is ``/etc/sysconfig/network-scripts`` with files named
ifcfg-<interface name>. For example, a file might be called ifcfg-enp8s0 and
In centOS this location is ``/etc/sysconfig/network-scripts`` with files named
ifcfg-<interface name>. For example, a file might be called ifcfg-enp8s0 and
have something like::

TYPE=Ethernet
Expand All @@ -242,16 +247,16 @@ have something like::
DEVICE=enp8s0
ONBOOT=yes
HWADDR=FF:FF:FF:FF:FF:FF
To add an additional interfaces on CentOS just create new files called

To add an additional interfaces on CentOS just create new files called
ifcfg-enp8s0:0 with a minimum of::

NAME="dot 4 subnet"
DEVICE=enp8s0:0
ONBOOT=yes
IPADDR=192.168.4.125
NETMASK=255.255.255.0

and so on with enp8s0:1::

NAME="dot 5 subnet"
Expand Down

0 comments on commit 8429a91

Please sign in to comment.