Skip to content

Commit

Permalink
Moving to a unified Status enum for Fortran errors.
Browse files Browse the repository at this point in the history
This is because they started to bubble up too many layers
and rewriting / renumbering had become cumbersome.
  • Loading branch information
dhermes committed Nov 17, 2017
1 parent 9609c16 commit 9fc8575
Show file tree
Hide file tree
Showing 19 changed files with 950 additions and 783 deletions.
24 changes: 24 additions & 0 deletions .circleci/expected_journal.txt
Expand Up @@ -35,6 +35,27 @@ $ /usr/bin/gfortran \
> -march=native \
> -c \
> -c \
> src/bezier/status.f90 \
> -o \
> build/temp.linux-x86_64-3.6/src/bezier/status.o \
> -J \
> build/temp.linux-x86_64-3.6
----------------------------------------
$ /usr/bin/gfortran \
> -Wall \
> -fno-second-underscore \
> -fPIC \
> -O3 \
> -funroll-loops \
> -Wextra \
> -Wno-compare-reals \
> -Wimplicit-interface \
> -fmax-errors=1 \
> -std=f2008 \
> -Werror \
> -march=native \
> -c \
> -c \
> src/bezier/helpers.f90 \
> -o \
> build/temp.linux-x86_64-3.6/src/bezier/helpers.o \
Expand Down Expand Up @@ -214,6 +235,7 @@ $ ar \
> build/temp.linux-x86_64-3.6/src/bezier/quadpack/dqk21.o \
> build/temp.linux-x86_64-3.6/src/bezier/quadpack/dqagse.o \
> build/temp.linux-x86_64-3.6/src/bezier/types.o \
> build/temp.linux-x86_64-3.6/src/bezier/status.o \
> build/temp.linux-x86_64-3.6/src/bezier/helpers.o \
> build/temp.linux-x86_64-3.6/src/bezier/curve.o \
> build/temp.linux-x86_64-3.6/src/bezier/surface.o \
Expand Down Expand Up @@ -350,6 +372,7 @@ $ gcc \
> -shared \
> build/temp.linux-x86_64-3.6/src/bezier/_curve_intersection_speedup.o \
> build/temp.linux-x86_64-3.6/src/bezier/types.o \
> build/temp.linux-x86_64-3.6/src/bezier/status.o \
> build/temp.linux-x86_64-3.6/src/bezier/helpers.o \
> build/temp.linux-x86_64-3.6/src/bezier/quadpack/d1mach.o \
> build/temp.linux-x86_64-3.6/src/bezier/quadpack/dqelg.o \
Expand Down Expand Up @@ -388,6 +411,7 @@ $ gcc \
> -shared \
> build/temp.linux-x86_64-3.6/src/bezier/_surface_intersection_speedup.o \
> build/temp.linux-x86_64-3.6/src/bezier/types.o \
> build/temp.linux-x86_64-3.6/src/bezier/status.o \
> build/temp.linux-x86_64-3.6/src/bezier/helpers.o \
> build/temp.linux-x86_64-3.6/src/bezier/quadpack/d1mach.o \
> build/temp.linux-x86_64-3.6/src/bezier/quadpack/dqelg.o \
Expand Down
22 changes: 22 additions & 0 deletions appveyor/expected_journal.txt
Expand Up @@ -35,6 +35,27 @@ $ C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\gfortran.exe \
> -funroll-loops \
> -c \
> -c \
> src\beziers\status.f90 \
> -o \
> build\temp.win-amd64-3.6\Release\src\bezier\status.o \
> -J \
> build\temp.win-amd64-3.6\Release
----------------------------------------
$ C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\gfortran.exe \
> -Wall \
> -fno-second-underscore \
> -O0 \
> -Wextra \
> -Wno-compare-reals \
> -Wimplicit-interface \
> -fmax-errors=1 \
> -std=f2008 \
> -Werror \
> -O3 \
> -march=native \
> -funroll-loops \
> -c \
> -c \
> src\bezier\helpers.f90 \
> -o \
> build\temp.win-amd64-3.6\Release\src\bezier\helpers.o \
Expand Down Expand Up @@ -206,6 +227,7 @@ $ C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\gfortran.exe \
> build\temp.win-amd64-3.6\Release\src\bezier\quadpack\dqk21.o \
> build\temp.win-amd64-3.6\Release\src\bezier\quadpack\dqagse.o \
> build\temp.win-amd64-3.6\Release\src\bezier\types.o \
> build\temp.win-amd64-3.6\Release\src\bezier\status.o \
> build\temp.win-amd64-3.6\Release\src\bezier\helpers.o \
> build\temp.win-amd64-3.6\Release\src\bezier\curve.o \
> build\temp.win-amd64-3.6\Release\src\bezier\surface.o \
Expand Down
2 changes: 2 additions & 0 deletions docs/native-libraries.rst
Expand Up @@ -133,6 +133,7 @@ The C headers for ``libbezier`` will be included in the installed package
curve.h
curve_intersection.h
helpers.h
status.h
surface.h
surface_intersection.h
bezier.h
Expand Down Expand Up @@ -162,6 +163,7 @@ Cython declaration files are provided:
_curve.pxd
_curve_intersection.pxd
_helpers.pxd
_status.pxd
_surface.pxd
_surface_intersection.pxd

Expand Down
2 changes: 2 additions & 0 deletions docs/native-libraries.rst.template
Expand Up @@ -133,6 +133,7 @@ The C headers for ``libbezier`` will be included in the installed package
curve.h
curve_intersection.h
helpers.h
status.h
surface.h
surface_intersection.h
bezier.h
Expand Down Expand Up @@ -162,6 +163,7 @@ Cython declaration files are provided:
_curve.pxd
_curve_intersection.pxd
_helpers.pxd
_status.pxd
_surface.pxd
_surface_intersection.pxd

Expand Down
56 changes: 56 additions & 0 deletions scripts/osx/travis_journal.txt
Expand Up @@ -69,6 +69,59 @@ $ /usr/local/bin/gfortran \
> -march=native \
> -c \
> -c \
> src/bezier/status.f90 \
> -o \
> ${TRAVIS_BUILD_DIR}/scripts/osx/tempdir-i386/status.o \
> -J \
> build/temp.macosx-10.6-intel-3.6
----------------------------------------
$ /usr/local/bin/gfortran \
> -Wall \
> -fno-second-underscore \
> -arch \
> x86_64 \
> -fPIC \
> -O3 \
> -funroll-loops \
> -Wextra \
> -Wno-compare-reals \
> -Wimplicit-interface \
> -fmax-errors=1 \
> -std=f2008 \
> -Werror \
> -march=native \
> -c \
> -c \
> src/bezier/status.f90 \
> -o \
> ${TRAVIS_BUILD_DIR}/scripts/osx/tempdir-x86_64/status.o \
> -J \
> build/temp.macosx-10.6-intel-3.6
----------------------------------------
$ lipo \
> ${TRAVIS_BUILD_DIR}/scripts/osx/tempdir-i386/status.o \
> ${TRAVIS_BUILD_DIR}/scripts/osx/tempdir-x86_64/status.o \
> -create \
> -output \
> build/temp.macosx-10.6-intel-3.6/src/bezier/status.o
----------------------------------------
$ /usr/local/bin/gfortran \
> -Wall \
> -fno-second-underscore \
> -arch \
> i386 \
> -fPIC \
> -O3 \
> -funroll-loops \
> -Wextra \
> -Wno-compare-reals \
> -Wimplicit-interface \
> -fmax-errors=1 \
> -std=f2008 \
> -Werror \
> -march=native \
> -c \
> -c \
> src/bezier/helpers.f90 \
> -o \
> ${TRAVIS_BUILD_DIR}/scripts/osx/tempdir-i386/helpers.o \
Expand Down Expand Up @@ -541,6 +594,7 @@ $ ar \
> build/temp.macosx-10.6-intel-3.6/src/bezier/quadpack/dqk21.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/quadpack/dqagse.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/types.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/status.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/helpers.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/curve.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/surface.o \
Expand Down Expand Up @@ -721,6 +775,7 @@ $ /usr/bin/clang \
> -g \
> build/temp.macosx-10.6-intel-3.6/src/bezier/_curve_intersection_speedup.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/types.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/status.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/helpers.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/quadpack/d1mach.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/quadpack/dqelg.o \
Expand Down Expand Up @@ -769,6 +824,7 @@ $ /usr/bin/clang \
> -g \
> build/temp.macosx-10.6-intel-3.6/src/bezier/_surface_intersection_speedup.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/types.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/status.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/helpers.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/quadpack/d1mach.o \
> build/temp.macosx-10.6-intel-3.6/src/bezier/quadpack/dqelg.o \
Expand Down
5 changes: 4 additions & 1 deletion setup_helpers.py
Expand Up @@ -97,6 +97,7 @@
# each value.
FORTRAN_MODULES = collections.OrderedDict()
FORTRAN_MODULES['types'] = ('types',)
FORTRAN_MODULES['status'] = ('status',)
FORTRAN_MODULES['helpers'] = ('types', 'helpers')
FORTRAN_MODULES['curve'] = (
'types',
Expand All @@ -121,6 +122,7 @@
)
FORTRAN_MODULES['curve_intersection'] = (
'types',
'status',
'helpers',
os.path.join(QUADPACK_DIR, 'd1mach'),
os.path.join(QUADPACK_DIR, 'dqelg'),
Expand All @@ -132,6 +134,7 @@
)
FORTRAN_MODULES['surface_intersection'] = (
'types',
'status',
'helpers',
os.path.join(QUADPACK_DIR, 'd1mach'),
os.path.join(QUADPACK_DIR, 'dqelg'),
Expand Down Expand Up @@ -235,7 +238,7 @@ def extension_modules():
libraries, library_dirs = BuildFortranThenExt.get_library_dirs()
extensions = []
for name, dependencies in FORTRAN_MODULES.items():
if name == 'types': # No speedup.
if name in ('types', 'status'): # No speedup.
continue

mod_name = 'bezier._{}_speedup'.format(name)
Expand Down
10 changes: 1 addition & 9 deletions src/bezier/_curve_intersection.pxd
Expand Up @@ -22,14 +22,6 @@ cdef extern from "bezier/curve_intersection.h":
TANGENT = 1
DISJOINT = 2

cpdef enum AllIntersectionsStatus:
SUCCESS = 0
NO_CONVERGE = 1
TOO_SMALL = 2
PARALLEL = 3
WIGGLE_FAIL = 4
UNKNOWN = 5

void linearization_error(
int *num_nodes, int *dimension, double *nodes, double *error)
void segment_intersection(
Expand All @@ -51,7 +43,7 @@ cdef extern from "bezier/curve_intersection.h":
double *error2, double *start2, double *end2, double *start_node2,
double *end_node2, int *num_nodes2, double *root_nodes2,
double *refined_s, double *refined_t,
bool_t *does_intersect, int *py_exc)
bool_t *does_intersect, int *status)
void bbox_line_intersect(
int *num_nodes, double *nodes, double *line_start, double *line_end,
int *enum_)
Expand Down

0 comments on commit 9fc8575

Please sign in to comment.