Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: fixes #288

Open
wants to merge 151 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
cc17c56
MAINT: include win32 headers
xoviat Oct 20, 2017
4fba341
ENH: allow getcpu to work on windows
xoviat Oct 20, 2017
c60f680
Windows Fixes
isuruf Oct 21, 2017
92afe7b
Remove ifndefs
isuruf Oct 21, 2017
17db496
Rename WIN32->_WIN32
isuruf Oct 21, 2017
f0f63ca
Add empty methods for __abort_* methods temporarily
isuruf Oct 21, 2017
1adca50
More windows fixes
isuruf Oct 21, 2017
1aab8cd
Don't use grep or sort
isuruf Oct 21, 2017
33ef678
Fix generating upperilm.sort
isuruf Oct 21, 2017
2d50a20
Add truncate definition; thanks to @xoviat
isuruf Oct 21, 2017
4632c1b
Add empty methods for mkstemp and vasprintf
isuruf Oct 21, 2017
50ede60
ENH: implement new win32 functions
xoviat Oct 21, 2017
c3a67fa
Use asprintf from https://github.com/littlstar/asprintf.c
isuruf Oct 21, 2017
2dc1e0c
Implement dtime3f for windows. credits to xoviat
isuruf Oct 21, 2017
9174a4e
Remove annoying asserts
isuruf Oct 21, 2017
80cc848
sed WINNT, WIN32, WIN64 -> _WIN32 for runtime/flang
isuruf Oct 21, 2017
d061cad
FIX anonymous structs
xoviat Oct 22, 2017
78cbebd
Fix CMake
isuruf Oct 22, 2017
ad7b0e2
Misc MSVC fixes
isuruf Oct 22, 2017
a260b46
sed UINT64->FLANG_UINT64
isuruf Oct 22, 2017
9be89a4
sed INT64->FLANG_INT64
isuruf Oct 22, 2017
93fe556
Revert "sed INT64->FLANG_INT64"
isuruf Oct 22, 2017
343ebbe
sed INT64->FLANG_INT64
isuruf Oct 22, 2017
199329d
FIX: update useless ifdef
xoviat Oct 23, 2017
2cb73b2
More windows fixes
isuruf Oct 23, 2017
fcdcf20
Fix CMakeLists.txt
isuruf Oct 24, 2017
6d2d5de
[runtime/amod] remove _win32 ifdefs
xoviat Oct 25, 2017
878305f
[runtime/utils] add gettimeofday
xoviat Oct 25, 2017
b4bfef5
Fix utils.c
isuruf Oct 24, 2017
14a6a71
Fix link errors by making empty methods for now
isuruf Oct 24, 2017
55140d2
remove differing declarations for windows
isuruf Oct 25, 2017
cd3c1ea
Set WINDOWS_EXPORT_ALL_SYMBOLS property for for shared flangrti target.
Oct 25, 2017
6dc6978
Set the target linker language for the flang libraries to CXX on wind…
Oct 25, 2017
446e390
Add appveyor.yml
isuruf Oct 25, 2017
b6ff98d
[cmake] add compiler definitions
xoviat Oct 25, 2017
ca4fe23
Revert "sed WINNT, WIN32, WIN64 -> _WIN32 for runtime/flang"
isuruf Oct 26, 2017
dd3561a
Update FuncArgMacros.h
isuruf Oct 26, 2017
88d5e51
[runtime/global] remove winnt ifdef
xoviat Oct 26, 2017
b3ce0e3
Remove unnecessary changes
isuruf Oct 26, 2017
8c14983
Add more target definitions
isuruf Oct 26, 2017
a84a7f8
[tools/flang2/exputil] fix getsname2
xoviat Oct 26, 2017
41562a5
Comment out insert_argrsrv
isuruf Oct 26, 2017
6f30c09
Fix linking errors
isuruf Oct 26, 2017
831f150
Fix missing ompstub.lib
Oct 26, 2017
db62727
Use "lib" prefix instead of "_static" suffix for static runtime libra…
Oct 26, 2017
27fa0d9
Fix main function
isuruf Oct 26, 2017
1e39f37
Add WINDOWS_EXPORT_ALL_SYMBOLS for shared flang library
Oct 26, 2017
128550c
[runtime/trace] create stackwalker
xoviat Oct 26, 2017
b24f16c
[cmake] add include directories and objects
xoviat Oct 26, 2017
8483ef9
[runtime/trace] fix header
xoviat Oct 26, 2017
907d679
[utils] implement fortio_binary_mode
xoviat Oct 26, 2017
669a8af
[runtime/iso_c] undefine linux
xoviat Oct 26, 2017
de6b981
Remove adding -DLINUX
isuruf Oct 26, 2017
9ca3a7a
[cmake] minor cleanup
xoviat Oct 26, 2017
d98604b
[cmake] always build tests
xoviat Oct 26, 2017
23ffa7a
[cmake] fix
xoviat Oct 26, 2017
085b5c6
[cmake] set standalone=1
xoviat Oct 27, 2017
cba0ec5
[cmake] show test suite message
xoviat Oct 27, 2017
86d9284
[lit] support windows
isuruf Oct 27, 2017
3112783
[cmake] revert changes
xoviat Oct 27, 2017
b278f10
[cmake/test] add verbose mode
xoviat Oct 27, 2017
d4b37da
[runtime/mthdecls] uncomment some functions
xoviat Oct 28, 2017
5b2d42a
Revert "[runtime/mthdecls] uncomment some functions"
isuruf Oct 28, 2017
7666f00
[runtime/flang]. re enable faint fsync (#23
xoviat Oct 28, 2017
086ca05
[runtime] fix trace handler (#24)
xoviat Oct 29, 2017
1e54c29
[runtime/curdir] implement gethostname (#25)
xoviat Oct 29, 2017
1922a57
[runtime/stdio] fix win32 defs (#26)
xoviat Oct 29, 2017
2e57878
Don't special case windows in lit.cfg
isuruf Oct 29, 2017
cf95a52
Download llvm source for additional tools
isuruf Oct 29, 2017
2623704
Comment downloading llvm
isuruf Oct 29, 2017
7256d11
Download only utils
isuruf Oct 29, 2017
6548729
Move msys path to front
isuruf Oct 29, 2017
c68e879
Workaround for lit
isuruf Oct 29, 2017
574eb91
[cmake] run tests in debug mode
xoviat Oct 29, 2017
dfb6acf
Remove running tests for now
isuruf Oct 29, 2017
a46cd40
[runtime/util] implement filetime_to_int64
xoviat Oct 29, 2017
71828d9
Make TARGET_OS and TARGET_ARCHITECTURE cached variables
isuruf Oct 29, 2017
5a77a7d
[runtime/include] add filetime header
xoviat Oct 29, 2017
b26a3be
[runtime/util] implement filetime emulation
xoviat Oct 29, 2017
a0d19a5
[runtime/dtime] include header
xoviat Oct 29, 2017
f5cad3c
[runtime/util] fix
xoviat Oct 29, 2017
f9341ce
Fix cmake warning
isuruf Oct 29, 2017
ff97e48
Fix nmake install
isuruf Oct 29, 2017
a064ff4
[runtime/util] fix
xoviat Oct 29, 2017
81e04a4
Update util.c
xoviat Oct 29, 2017
4cb8a61
Align to cache line set to 32 for windows
isuruf Oct 30, 2017
a1bd1cd
Signal: drop handlers (#42)
xoviat Nov 1, 2017
eb40c0b
Ws2 32 (#43)
xoviat Nov 1, 2017
ecf31e4
[flang2/ll_structure] add linker options to enum
xoviat Nov 1, 2017
f542d67
ifdef for LLVM version
isuruf Nov 3, 2017
ad54611
Fix for -linker -directive
isuruf Nov 3, 2017
856e4b8
Revert "Fix for -linker -directive"
isuruf Nov 4, 2017
0f8c27b
Check LLVM version at runtime
isuruf Nov 4, 2017
623b71f
[flang2:ll_structure] fix name
xoviat Nov 4, 2017
7108e6b
Send `-no-flang-libs` when compiling flang.lib
isuruf Nov 6, 2017
120c333
Fix libomp searching
isuruf Nov 8, 2017
442c686
Add asprintf.c unconditionally to avoid errors
isuruf Nov 8, 2017
b1dbb00
Fix header
isuruf Nov 8, 2017
96f2644
Add -DPGDLL
isuruf Dec 1, 2017
fcfddeb
[travis] init
xoviat Dec 14, 2017
3a6f2f4
[cmake] fix arch
xoviat Dec 15, 2017
c738f49
Revert flang_int64 / flang_uint64
xoviat Dec 18, 2017
8937577
[runtime] redefined INT64 type
xoviat Dec 18, 2017
5540d27
Fix floating-point register behavior on win32
xoviat Dec 20, 2017
7e5baa2
Install conda=4.3
isuruf Dec 22, 2017
bc1761d
Fix complex matrix multiplication
xoviat Dec 21, 2017
f70c7b7
Register boolean "es" argument.
xoviat Dec 28, 2017
c45ea61
Remove dependency that confused ninja-build.
xoviat Dec 28, 2017
6315df5
Set preprocessor filename to output filename
xoviat Dec 28, 2017
856a96b
Merge pull request #88 from isuruf/ninja-build
xoviat Dec 28, 2017
1bc7adb
Fix regression in host-fp-folding
xoviat Dec 29, 2017
f7ca018
Fix CMake regression
xoviat Dec 29, 2017
281cc42
CMake: do depdencies correctly
xoviat Dec 29, 2017
a9daa89
one
xoviat Dec 29, 2017
31950cc
CMake: Fix missing symbols introduced in gh-90
xoviat Dec 30, 2017
f94b2c5
Fix CMake Warning
isuruf Dec 30, 2017
0cc7ab5
Run make install in travis.yml
isuruf Dec 30, 2017
78d1589
Don't check fortran ABI
isuruf Dec 30, 2017
683d410
Update .appveyor.yml
isuruf Dec 30, 2017
b594878
Flang support F90
isuruf Dec 30, 2017
48077b4
Make iso_c_bind OBJECT libraries so that no linking is done
isuruf Dec 30, 2017
d632315
Travis: disable testing
xoviat Dec 30, 2017
a1009b9
Travis: set branches
xoviat Dec 30, 2017
550cdb8
Test install in appveyor
isuruf Dec 31, 2017
1ab1d9b
Fix install
isuruf Dec 31, 2017
a0160d7
Fix Fortran compiler identification
isuruf Dec 31, 2017
4ca7af6
Fix parallel build failures
isuruf Dec 31, 2017
50ed86e
reduce diff
isuruf Dec 31, 2017
521a5b5
Fix install failure
isuruf Dec 31, 2017
90c6470
Add workaround for ninja
isuruf Dec 31, 2017
12859cf
Fix incorrect rounding behavior
xoviat Dec 31, 2017
1070803
Remove unnedded functions
xoviat Dec 31, 2017
09072d9
Revert "Revert "CMake: Cleanup depedency issues""
xoviat Dec 31, 2017
3595879
CMake: set fortran module directory for static
xoviat Dec 31, 2017
3d45b53
CMake: remove library dependency
xoviat Dec 31, 2017
05134c8
Fix warnings
isuruf Jan 1, 2018
e315207
CMake: fix build race condition
xoviat Jan 1, 2018
371f751
CMake: fix race conditions
xoviat Jan 1, 2018
0073abe
Add "use" statements to require modules
xoviat Jan 1, 2018
39e9250
Merge pull request #113 from isuruf/fix-race
isuruf Jan 1, 2018
90b9da3
Merge pull request #115 from flang-compiler/master
xoviat Jan 2, 2018
a5cac1f
CMake handles module dependencies now that flang -E works
isuruf Jan 12, 2018
577c8e8
Merge pull request #119 from isuruf/mod
xoviat Jan 12, 2018
7c7f39c
Merge pull request #120 from flang-compiler/master
xoviat Jan 12, 2018
db2935b
Merge pull request #121 from flang-compiler/master
xoviat Jan 17, 2018
6e7bd95
Merge pull request #122 from flang-compiler/master
xoviat Jan 20, 2018
9158963
Merge pull request #124 from flang-compiler/master
xoviat Jan 28, 2018
d2ba3c4
Appveyor: cache packages
xoviat Jan 30, 2018
ccc1502
Trigger build
xoviat Jan 30, 2018
4ddc948
Merge pull request #126 from flang-compiler/master
xoviat Feb 8, 2018
e160efe
Merge pull request #127 from flang-compiler/master
xoviat Feb 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
branches:
only:
- master
- windows
- windows-rebased

environment:
global:
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
APPVEYOR_SAVE_CACHE_ON_FAILURE: true

cache:
- '%CONDA_INSTALL_LOCN%\pkgs'

os: Visual Studio 2017

platform:
- x64

install:
# Add path, activate `conda` and update conda.
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
# Add our channels.
- cmd: conda config --add channels defaults
- cmd: conda config --add channels conda-forge
- cmd: conda install --yes llvmdev clangdev flang-meta cmake
- cmd: conda install --yes -c isuruf kitware-ninja


build_script:
- ps: mkdir build

- cd build
- set "PATH=%cd%\bin;%PATH%"
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% -DFLANG_INCLUDE_TESTS=ON -DFLANG_TEST_VERBOSE_MODE=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_INCLUDE_TESTS=ON -DLLVM_MAIN_SRC_DIR=C:\llvm_src ..
- ps: |
Push-AppveyorArtifact .\CMakeFiles\CMakeOutput.log
Push-AppveyorArtifact .\CMakeFiles\CMakeError.log

- ps: |
cmake --build . 2>&1 | Out-File build_output.txt
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this checking the error code of Push-AppveyorArtifact?

Copy link
Author

Choose a reason for hiding this comment

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

That's correct. Ugh.

Push-AppveyorArtifact .\build_output.txt
Get-Content .\build_output.txt -Tail 500

- ps: Compress-Archive -Path C:\projects\flang\build\bin -DestinationPath C:\Projects\flang\bin.zip
- ps: Push-AppveyorArtifact C:\Projects\flang\bin.zip
- ps: Compress-Archive -Path C:\projects\flang\build\lib -DestinationPath C:\Projects\flang\lib.zip
- ps: Push-AppveyorArtifact C:\Projects\flang\lib.zip

test_script:
- cmd: cmake --build . --target install
44 changes: 44 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
language: c

cache:
directories:
- $HOME/.conda/pkgs
- $HOME/miniconda/pkgs

branches:
only:
- master
- windows

install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -u -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge --force
- conda update -q conda

- conda create -q -n test-environment
flang-meta
llvmdev
clangdev
openmp
cmake

- source activate test-environment
- conda info -a

# For testing
#- pip install lit

script:
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DFLANG_INCLUDE_TESTS=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_Fortran_COMPILER=flang ..
- make -j4
- make install -j4
#- make check-flang

notifications:
email: false
40 changes: 27 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ cmake_minimum_required(VERSION 2.8)
# In order to bootstrap the runtime library we need to skip
# CMake's Fortran tests
SET(CMAKE_Fortran_COMPILER_WORKS 1)
SET(CMAKE_Fortran_ABI_COMPILED 0)
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
SET(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
SET(CMAKE_Fortran_MODDIR_FLAG "-module ")

if( NOT DEFINED TARGET_ARCHITECTURE )
execute_process(COMMAND uname -m OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE TARGET_ARCHITECTURE)
# If we are not building as a part of LLVM, build Flang as an
# standalone project, using LLVM as an external library:
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
project(Flang)
endif()

if( NOT DEFINED TARGET_OS )
execute_process(COMMAND uname -s OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE TARGET_OS)
endif()
set(TARGET_OS ${CMAKE_HOST_SYSTEM_NAME} CACHE STRING "Target OS")
set(TARGET_ARCHITECTURE ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE STRING "Target Architecture")

if( ${TARGET_OS} STREQUAL "Linux" )
set(OS "LINUX")
Expand All @@ -51,16 +55,26 @@ if( ${TARGET_OS} STREQUAL "Linux" )
message("Unsupported architecture: ${TARGET_ARCHITECTURE}" )
return()
endif()
elseif(${TARGET_OS} STREQUAL "Windows" )
set(OS "WINDOWS")
set(OSNAME "Windows")
add_definitions(-DWIN32 -DHOST_WIN -DWINNT -DTARGET_WIN -DTARGET_WIN_X86)
if( ${TARGET_ARCHITECTURE} STREQUAL "AMD64" )
add_definitions(-DWIN64 -DTARGET_WIN_X8664)
set(TARGET_ARCHITECTURE "x86_64")
set(ARCHNAME x86-64)
set(ARCH X86)
set(WRDSZ 64)
else()
add_definitions(-DTARGET_WIN_X8632)
message("Unsupported architecture: ${TARGET_ARCHITECTURE}" )
return()
endif()
else()
message("Unsupported OS: ${TARGET_OS}" )
return()
endif()

# The cmake documentation states that these are set. They are not so we
# set them here
set(CMAKE_HOST_SYSTEM_NAME ${TARGET_OS})
set(CMAKE_HOST_SYSTEM_PROCESSOR ${TARGET_ARCHITECTURE})

# If we are not building as a part of LLVM, build Flang as an
# standalone project, using LLVM as an external library:
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
Expand Down Expand Up @@ -326,7 +340,7 @@ macro(add_flang_library name)
endif( LLVM_COMMON_DEPENDS )

llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
target_link_libraries( ${name} ${LLVM_COMMON_LIBS})
# link_system_libs( ${name} ) # getd of cmake warning messages

install(TARGETS ${name}
Expand Down
1 change: 1 addition & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


2 changes: 2 additions & 0 deletions include/legacy-util-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#include <time.h> /* time() */
#ifndef _WIN32
#include <unistd.h> /* getcwd() */
#endif

/* See tmpfile(3). */
FILE *tmpf(char *ignored);
Expand Down
32 changes: 32 additions & 0 deletions lib/scutil/cpu-stopwatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* since the most recent call. Very much not thread-safe.
*/

#ifndef _WIN32

#include <sys/times.h>
#include <unistd.h>
#include "scutil.h"
Expand Down Expand Up @@ -51,3 +53,33 @@ getcpu(void)
last = now;
return elapsed;
}

#else

#include <Windows.h>
//#include "scutil.h"

unsigned long
getcpu(void)
{
LARGE_INTEGER ticks_per_second = {-1};
LARGE_INTEGER ticks;

unsigned long last = 0;
unsigned long now, elapsed;

/* Initialize ticks_per_second. */
if (ticks_per_second.QuadPart <= 0)
QueryPerformanceFrequency(&ticks_per_second.QuadPart);

QueryPerformanceCounter(&ticks);
now = ticks.QuadPart;
now *= 1000; /* milliseconds */
now /= ticks_per_second.QuadPart;

elapsed = now - last;
last = now;
return elapsed;
}

#endif
23 changes: 19 additions & 4 deletions lib/scutil/host-fp-folding.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <mmintrin.h>
#endif

/*
* Build-time sanity checks
Expand Down Expand Up @@ -82,15 +85,27 @@ configure_denormals(bool denorms_are_zeros, bool flush_to_zero)
if (fegetenv(&fenv) != 0)
fprintf(stderr, "fegetenv() failed: %s\n", strerror(errno));
#ifdef __x86_64__
fenv.__mxcsr &= ~0x0040;
#ifdef _WIN32
unsigned int mxcsr = _mm_getcsr();
#else
unsigned int mxcsr = fenv.__mxcsr;
#endif
mxcsr &= ~0x0040;
if (denorms_are_zeros)
fenv.__mxcsr |= 0x0040;
fenv.__mxcsr &= ~0x8000;
mxcsr |= 0x0040;
mxcsr &= ~0x8000;
if (flush_to_zero)
fenv.__mxcsr |= 0x8000;
mxcsr |= 0x8000;
#ifdef _WIN32
_mm_setcsr( mxcsr );
#else
fenv.__mxcsr = mxcsr;
#endif
#endif
#ifndef _WIN32
if (fesetenv(&fenv) != 0)
fprintf(stderr, "fesetenv() failed: %s\n", strerror(errno));
#endif
}

/*
Expand Down
10 changes: 9 additions & 1 deletion lib/scutil/lockfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
* Clean up by deleting the uniquely named file we had created earlier.
*/

#include <unistd.h>
#ifndef _WIN32
#include <unistd.h>
#else
#include <Winsock2.h>
#include <process.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
Expand All @@ -64,6 +69,9 @@ static char *udir = NULL;
*/
static long uwaiting;

#ifdef _WIN32
#define pid_t int
#endif
int
__pg_make_lock_file(char *dir)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/scutil/path-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "legacy-util-api.h"
#include <stddef.h>
#include <string.h>
#ifndef _WIN32
#include <unistd.h> /* access() */
#endif

void
basenam(const char *orig_path, const char *optional_suffix, char *basename)
Expand Down
5 changes: 5 additions & 0 deletions lib/scutil/pgnewfil.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#if defined(HOST_WIN)
#include <direct.h>
#include <io.h>
#include <sys/stat.h>
extern unsigned long getpid(void);
#else
#include <unistd.h>
Expand All @@ -42,6 +43,10 @@ int pgnewfil_debug = 0;
#endif
extern size_t strlen();

#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif

/*
* copy chars from q to p, terminate string, return end of string
*/
Expand Down
12 changes: 9 additions & 3 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ add_definitions(
-DMAXCPUS=256
-DMAXCPUSL=8
-DMAXCPUSR=8
-DTARGET_LINUX
-DTARGET_LLVM
-DLINUX
-DPGF90
-DPGF90
-DPGFLANG
-DNATIVE_FPCVT
-DPGI_LITTLE_ENDIAN
)

if( ${TARGET_OS} STREQUAL "Linux" )
add_definitions(
-DTARGET_LINUX
-DLINUX
)
endif()


if( ${TARGET_ARCHITECTURE} STREQUAL "x86_64" )
add_definitions(
-DTARGET_X8664
Expand Down
Loading