Skip to content

Commit

Permalink
maint: Merge default to bytecode-interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
arungiridhar committed Jan 18, 2024
2 parents aa7b15e + 2aef8f3 commit 8db904b
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 18 deletions.
74 changes: 66 additions & 8 deletions .github/workflows/make.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ jobs:
echo "history_file (make_absolute_filename ('./a/b/c/history')); disp ('test')" | ./.build/run-octave -i
[ -f ./a/b/c/history ] || echo "::warning::Creating history file failed"
- name: install
run: |
sudo make -C ./.build install
- name: test stand-alone executable
run: |
cd examples/code
mkoctfile --link-stand-alone embedded.cc -o embedded
LD_LIBRARY_PATH="/usr/local/lib/octave/$(octave --eval "disp(version())")" \
./embedded
alpine:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -311,6 +322,8 @@ jobs:
test -d ~/.ccache || mkdir ~/.ccache
echo "max_size = 1G" >> ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache --version
ccache -p
ccache -s
echo "/usr/lib/ccache/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -433,6 +446,16 @@ jobs:
echo "history_file (make_absolute_filename ('./a/b/c/history')); disp ('test')" | ./.build/run-octave -i
[ -f ./a/b/c/history ] || echo "::warning::Creating history file failed"
- name: install
run: |
sudo make -C ./.build install
- name: test stand-alone executable
run: |
cd examples/code
mkoctfile --link-stand-alone embedded.cc -o embedded
LD_LIBRARY_PATH="/usr/local/lib/octave/$(octave --eval "disp(version())")" ./embedded
macos:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -665,6 +688,18 @@ jobs:
echo "history_file (make_absolute_filename ('./a/b/c/history')); disp ('test')" | ./.build/run-octave -i
[ -f ./a/b/c/history ] || echo "::warning::Creating history file failed"
- name: install
run: |
mkdir -p /Users/runner/usr
make -C ./.build install
- name: test stand-alone executable
run: |
cd examples/code
PATH="/Users/runner/usr/bin:$PATH" CXX="${CXX} -std=gnu++11" \
mkoctfile --link-stand-alone embedded.cc -o embedded
./embedded
mingw:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -693,6 +728,7 @@ jobs:
f77: gfortran
extra-config-flags: ""
ccache-max: 0.9G
allow-error: false
- msystem: CLANG64
mingw-prefix: clang64
target-prefix: mingw-w64-clang-x86_64
Expand All @@ -704,10 +740,11 @@ jobs:
# autoconf and libtool still need help to correctly invoke flang.
extra-config-flags:
--disable-lib-visibility-flags
--enable-fortran-calling-convention=gfortran
ac_cv_f77_compiler_gnu=yes
lt_cv_prog_gnu_ld=yes
ccache-max: 400M
# This configuration is not fully supported yet
allow-error: true

env:
CHERE_INVOKING: 1
Expand Down Expand Up @@ -829,6 +866,7 @@ jobs:
# FIXME: Fix building with Java support. Override JAVA_HOME for now.
# FIXME: How do we get a working TeX environment in MSYS2? Disable building the documentation for now.
run: |
echo $PATH
which $CC
echo $CC --version
$CC --version
Expand Down Expand Up @@ -929,18 +967,26 @@ jobs:
echo "history_file (make_absolute_filename ('./a/b/c/history')); disp ('test')" | ./.build/run-octave -i
[ -f ./a/b/c/history ] || echo "::warning::Creating history file failed"
- name: install and compress
if: matrix.msystem == 'MINGW64'
continue-on-error: true
- name: install
run: |
echo "::group::Installing Octave"
mkdir -p /c/octave/pkg
make -C ./.build DESTDIR=/c/octave/pkg install
echo "::endgroup::"
echo "::group::Compressing Octave package"
- name: test stand-alone executable
continue-on-error: ${{ matrix.allow-error }}
run: |
cd examples/code
export PATH=$(echo "$PATH" | sed -e "s|$MINGW_PREFIX/lib/ccache/bin:||g")
export PATH="/c/octave/pkg/${{ matrix.mingw-prefix }}/bin:$PATH"
mkoctfile --link-stand-alone embedded.cc -o embedded
./embedded.exe
- name: compress build artifact
if: matrix.msystem == 'MINGW64'
continue-on-error: true
run: |
cd /c/octave/pkg
tar -cvzf octave.tar.gz *
echo "::endgroup::"
- name: upload build artifact
if: matrix.msystem == 'MINGW64'
Expand Down Expand Up @@ -1107,6 +1153,7 @@ jobs:
# FIXME: Fix building with Java support. Override JAVA_HOME for now.
# FIXME: How do we get a working TeX environment in Cygwin? Disable building the documentation for now.
run: |
echo $PATH
which $CC
echo $CC --version
$CC --version
Expand Down Expand Up @@ -1206,3 +1253,14 @@ jobs:
run: |
echo "history_file (make_absolute_filename ('./a/b/c/history')); disp ('test')" | ./.build/run-octave -i
[ -f ./a/b/c/history ] || echo "::warning::Creating history file failed"
- name: install
run: |
make -C ./.build install
- name: test stand-alone executable
run: |
export PATH=$(echo "$PATH" | sed -e "s|/usr/lib/ccache/bin:||g")
cd examples/code
mkoctfile --link-stand-alone embedded.cc -o embedded
./embedded.exe
10 changes: 7 additions & 3 deletions libinterp/corefcn/oct-stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,14 @@ class OCTINTERP_API base_stream
std::ostream *os = output_stream ();
if (os && *os)
{
// FIXME: Using std::make_unique could simplify the following
// expressions once we require C++14.
m_converter
= std::make_unique<std::wbuffer_convert<convfacet_u8, char>>
(os->rdbuf (), new convfacet_u8 (m_encoding));
m_conv_ostream = std::make_unique<std::ostream> (m_converter.get ());
= std::unique_ptr<std::wbuffer_convert<convfacet_u8, char>>
(new std::wbuffer_convert<convfacet_u8, char>
(os->rdbuf (), new convfacet_u8 (m_encoding)));
m_conv_ostream = std::unique_ptr<std::ostream>
(new std::ostream (m_converter.get ()));
}

return (m_conv_ostream ? m_conv_ostream.get () : output_stream ());
Expand Down
9 changes: 3 additions & 6 deletions libinterp/parse-tree/oct-parse.yy
Original file line number Diff line number Diff line change
Expand Up @@ -5525,10 +5525,7 @@ OCTAVE_BEGIN_NAMESPACE(octave)
if (in_file)
{
output_buf << str
<< " near line " << err_line << ", column " << err_col << "\n"
<< "error: called from\n"
<< " " << m_lexer.m_fcn_file_name
<< " at line " << err_line << " column " << err_col << "\n";
<< " near line " << err_line << ", column " << err_col << "\n";
}
else
{
Expand Down Expand Up @@ -5620,7 +5617,7 @@ OCTAVE_BEGIN_NAMESPACE(octave)
}

if (status != 0)
parse_error ("%s", m_parse_error_msg.c_str ());
parse_error_with_id ("Octave:parse-error", "%s", m_parse_error_msg.c_str ());

return status;
}
Expand Down Expand Up @@ -5692,7 +5689,7 @@ OCTAVE_BEGIN_NAMESPACE(octave)
while (status == YYPUSH_MORE || ! m_lexer.at_end_of_buffer ());

if (status != 0)
parse_error ("%s", m_parse_error_msg.c_str ());
parse_error_with_id ("Octave:parse-error", "%s", m_parse_error_msg.c_str ());

return status;
}
Expand Down
3 changes: 3 additions & 0 deletions scripts/help/error_ids.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
## @item Octave:invalid-input-arg
## Indicates that a function was called with invalid input arguments.
##
## @item Octave:parse-error
## The interpreter failed to parse (read) specified code.
##
## @item Octave:undefined-function
## Indicates a call to a function that is not defined. The function may exist
## but Octave is unable to find it in the search path.
Expand Down
2 changes: 1 addition & 1 deletion test/classdef/classdef.tst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
%! obj = obj.move_element_to_end (2);
%! assert (isequal (obj.element, [1 3 2]));

%!error <parse error> plist_t1
%!error <syntax error> plist_t1
%!assert (strcmp (class (plist_t2), 'plist_t2'))
%!assert (strcmp (class (plist_t3), 'plist_t3'))

Expand Down

0 comments on commit 8db904b

Please sign in to comment.