Skip to content

Commit

Permalink
Fixes #227
Browse files Browse the repository at this point in the history
Because the new windows-install.sh uses Ubuntu 16.04, which comes with Windows Subsystem for Linux (WSL),
our Windows installer can be tested in Linux image on Travis-CI.  Our release notes should indicate
the following limitations:
1. The Windows installer builds the default GCC installed by apt-get, which is 5.4.0 for Ubuntu 16.04.
2. Ubuntu 16.04 comes with WSL releases 14936 or later.
3. Updating to 16.04 requires joining the Windows Insider Preview program, selecting "Fast" updates, and running do-release-upgrade.
  • Loading branch information
rouson committed Jan 19, 2017
1 parent 7f0b4ba commit 26e9991
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions windows-install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#/usr/bin/env bash
#
# windows-install.sh
#
Expand Down Expand Up @@ -79,8 +79,6 @@
# (3) Parse the usage information (default usage file name: current file's name with -usage appended).
# (4) Parse the command line using the usage information.

starting_directory=${PWD}

### Start of boilerplate -- do not edit this block #######################
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%/}}"
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
Expand Down Expand Up @@ -246,34 +244,33 @@ else
sudo apt-get install mpich
fi

# Install OpenCoarrays


set_SUDO_if_needed_to_write_to_install_dir()
{
info "Checking whether the directory ${install_prefix} exists... "
if [[ -d "${install_prefix}" ]]; then
info "yes"
info "Checking whether I have write permissions to ${install_prefix} ... "
if [[ -w "${install_prefix}" ]]; then
set_SUDO_if_needed_to_write_to_install_dir()
{
info "Checking whether the directory ${install_prefix} exists... "
if [[ -d "${install_prefix}" ]]; then
info "yes"
info "Checking whether I have write permissions to ${install_prefix} ... "
if [[ -w "${install_prefix}" ]]; then
info "yes"
else
info "no"
SUDO="sudo"
fi
else
info "no"
SUDO="sudo"
fi
else
info "no"
info "Checking whether I can create ${install_prefix} ... "
if mkdir -p "${install_prefix}" >& /dev/null; then
info "yes."
else
info "no."
SUDO="sudo"
info "Checking whether I can create ${install_prefix} ... "
if mkdir -p "${install_prefix}" >& /dev/null; then
info "yes."
else
info "no."
SUDO="sudo"
fi
fi
fi
}
set_SUDO_if_needed_to_write_to_install_dir
}
set_SUDO_if_needed_to_write_to_install_dir

# Install OpenCoarrays

if [[ -d "$build_path" ]]; then
rm -rf "$build_path"
fi
Expand Down

7 comments on commit 26e9991

@zbeekman
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to test this on Travis-CI we should be testing with Ubuntu 16.04, right? Unfortunately this will be non-trivial, since Travis provides 12.04 and 14.04 only, by default. The way to test with 16.04 would be to setup a docker image... I can do this, someday, when I have the time.

@rouson
Copy link
Member Author

@rouson rouson commented on 26e9991 Jan 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. 16.04 is required because it installs GCC 5.4.0, whereas 14.04's apt-get installs GCC 4.8.

No rush. The windows-install.sh script is considerably simpler than install.sh because it is safe to assume the presence of apt-get so all prerequisites are installed with sudo apt-get install ... and there's no need for recursion or stack management or downloading anything directly. It's a much simpler world. :)

@zbeekman
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rouson FYI, you can do this on most Ubuntu distros to get modern compilers:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

Then sudo apt-get install gcc gfortran g++ should get you 6.x even on 14.04. This probably works in older versions of Ubuntu as well... I'm wondering if this is worth testing. Could this possibly allow WSL builds even when the user is not in the fast-track/early release program?

@rouson
Copy link
Member Author

@rouson rouson commented on 26e9991 Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested commands didn't work. The output is below. I don't think either of us should spend any more time on this without a specific user request. If a user requests an update to a newer gfortran, then we can enlist the user in assisting with finding a solution and testing it.

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 Toolchain test builds; see https://wiki.ubuntu.com/ToolChain

 More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpp464eaga/secring.gpg' created
gpg: keyring `/tmp/tmpp464eaga/pubring.gpg' created
gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpp464eaga/trustdb.gpg: trustdb created
gpg: key BA9EF27F: public key "Launchpad Toolchain builds" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB] 
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease [17.6 kB] 
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB] 
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB] 
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [201 kB] 
Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [70.0 kB] 
Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [38.0 kB] 
Get:9 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial/main amd64 Packages [50.1 kB] 
Get:10 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial/main Translation-en [12.1 kB] 
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [453 kB] 
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [179 kB] 
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [381 kB] 
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [140 kB] 
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [8,080 B]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [3,580 B]
Get:17 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4,404 B]
Fetched 1,865 kB in 9s (207 kB/s)
Reading package lists... Done
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
$ sudo apt-get install gcc gfortran g++ 
[sudo] password for rouson:
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:5.3.1-1ubuntu1).
gcc is already the newest version (4:5.3.1-1ubuntu1).
gcc set to manually installed.
gfortran is already the newest version (4:5.3.1-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
$ gfortran --version
GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

@zbeekman
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think either of us should spend any more time on this without a specific user request.

Sounds good.... without a Windows system I just thought it might be worth testing that, since it's what I normally do on older ubuntu systems.... For now I think the windows script is going to have to go untested in our CI process... Soon I hope to get shellcheck up and running, and we can throw that at it, but getting 16.04 is up and running on Travis-CI is going to be a bit time consuming.

@rouson
Copy link
Member Author

@rouson rouson commented on 26e9991 Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also recommend against working on getting 16.04 running. It will eventually be the default on WSL. I'll mention this on comp.lang.fortran and in the LinkedIn Fortran Programmers list in case anyone can provide insights.

@rouson
Copy link
Member Author

@rouson rouson commented on 26e9991 Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... my reasoning on the last comment was erroneous (Ubuntu 16.04 becoming the default on WSL is unrelated to whether you should try to get it running in Travis-CI). Nonetheless, my conclusion would be the same: not worth the effort without a user request.

Please sign in to comment.