diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..daa3bdde8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,127 @@ +--- +name: "Build and Test" +"on": [push, pull_request] +jobs: + pre_build: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + concurrent_skipping: 'same_content' + skip_after_successful_duplicate: 'true' + do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' + build: + needs: pre_build + if: ${{ needs.pre_build.outputs.should_skip != 'true' }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [self-hosted, ubuntu-latest, macos-latest] + python-version: ['3.8', '3.10', '3.12'] + include: + - os: ubuntu-20.04 + python-version: '3.6' + - os: macos-latest + python-version: '3.6' + fail-fast: false + steps: + - name: "Software Install - Ubuntu" + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-20.04' || matrix.os == 'self-hosted' }} + run: | + sudo apt-get update && \ + sudo apt-get install -y \ + build-essential \ + ca-certificates \ + curl \ + exuberant-ctags \ + gfortran \ + git \ + libhwloc-dev \ + libopenblas-dev \ + pkg-config \ + software-properties-common + - name: "Software Install - MacOS" + if: ${{ matrix.os == 'macos-latest' }} + run: | + brew install \ + curl \ + ctags-exuberant \ + gawk \ + gnu-sed \ + hwloc \ + pkg-config + - uses: actions/setup-python@v5.0.0 + with: + python-version: ${{ matrix.python-version }} + - name: "Software Install - Python" + run: python -m pip install \ + setuptools \ + "numpy<2" \ + matplotlib \ + contextlib2 \ + simplejson \ + pint \ + graphviz \ + ctypesgen==1.0.2 \ + pylint \ + coverage + - name: "Software Install - Python, part 2" + if: ${{ matrix.os == 'self-hosted' }} + # Setting CPLUS_INCLUDE_PATH helps pycuda find the right + # Python header files to use with its embedded + # subset of Boost. + env: + CPLUS_INCLUDE_PATH: "${{ env.pythonLocation }}/include/python\ + ${{ matrix.python-version }}" + run: python -m pip install \ + cupy-cuda12x \ + pycuda \ + numba \ + jupyterlab \ + jupyter_client \ + nbformat \ + nbconvert + - uses: actions/checkout@v3 + - name: "Build and Install" + run: | + ./configure + make -j all + sudo make install + - name: Test + env: + LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }} + run: | + python -m pip install scipy + cd test + bash ./download_test_data.sh + python -c "from bifrost import telemetry; telemetry.disable()" + coverage run --source=bifrost.ring,bifrost,bifrost.pipeline \ + -m unittest discover + coverage xml + - name: "Test, part 2" + if: ${{ matrix.os == 'self-hosted' }} + env: + LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }} + run: | + cd testbench + python generate_test_data.py + coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_file_read_write.py + coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_fft.py + coverage run --source=bifrost.ring,bifrost,bifrost.pipeline your_first_block.py + python download_breakthrough_listen_data.py -y + coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_fdmt.py ./testdata/pulsars/blc0_guppi_57407_61054_PSR_J1840%2B5640_0004.fil + coverage xml + - name: "Upload Coverage" + env: + UNITTEST_OS: ${{ matrix.os }} + UNITTEST_PY: ${{ matrix.python-version }} + if: ${{ matrix.os == 'self-hosted' && matrix.python-version == '3.8' }} + uses: codecov/codecov-action@v4 + with: + files: ./test/coverage.xml, ./testbench/coverage.xml + env_vars: UNITTEST_OS,UNITTEST_PY + fail_ci_if_error: false + verbose: true diff --git a/.gitignore b/.gitignore index 74a87e23a..fd4652dda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,23 @@ doc version.py +/python/bifrost/version/__init__.py *_generated.py +*_typehints.py .log*.txt test/data/ *.bin +# Local configuration +aclocal.m4 +autom4te.cache +config.status +config.mk +Makefile +src/Makefile +python/Makefile +share/bifrost.pc +src/bifrost/config.h + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/.mypy.ini b/.mypy.ini new file mode 100644 index 000000000..34d271542 --- /dev/null +++ b/.mypy.ini @@ -0,0 +1,4 @@ +[mypy] + +[mypy-scipy.fftpack.*] +ignore_missing_imports = True diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a4193aa2c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -dist: bionic - -dist: bionic - -language: python - -python: - - 2.7 - - 3.6 - # PyPy versions - - pypy2.7-6.0 - - pypy3 - -services: - - docker - -addons: - apt: - update: true - packages: - - build-essential - - ca-certificates - - curl - - git - - pkg-config - - software-properties-common - - exuberant-ctags - - python-dev - - pylint - -jobs: - include: - - stage: docker and deploy docs - python: 2.7 - script: - - make docker-cpu - - make docker - - bash ./.travis_deploy_docs.sh - allow_failures: - - python: 2.7 - - python: pypy2.7-6.0 - -script: - - sudo pip --no-cache-dir install \ - setuptools \ - numpy \ - matplotlib \ - contextlib2 \ - simplejson \ - pint \ - graphviz \ - git+https://github.com/olsonse/ctypesgen.git@9bd2d249aa4011c6383a10890ec6f203d7b7990f \ - coveralls \ - codecov - - sudo make -j NOCUDA=1 - - sudo make install - - export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} - - cd test && sudo -E bash ./travis.sh && cd .. - -env: - global: - - ENCRYPTION_LABEL: "886f75ecbd69" - - COMMIT_AUTHOR_EMAIL: "travis@ledatelescope.github.io" - -after_success: - - cd test - - coveralls - - codecov diff --git a/BifrostDemo.ipynb b/BifrostDemo.ipynb new file mode 100644 index 000000000..8ef5c0cc8 --- /dev/null +++ b/BifrostDemo.ipynb @@ -0,0 +1,248 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "tayN_DCBZgmn" + }, + "source": [ + "\n", + "## Instructions\n", + "1. Work on a copy of this notebook: _File_ > _Save a copy in Drive_ (you will need a Google account). Alternatively, you can download the notebook using _File_ > _Download .ipynb_, then upload it to [Colab](https://colab.research.google.com/).\n", + "2. Turn on the GPU with Edit->Notebook settings->Hardware accelerator->GPU\n", + "3. Execute the following cell (click on it and press Ctrl+Enter) to install dependencies.\n", + "4. Continue to the next section.\n", + "\n", + "_Notes_:\n", + "* If your Colab Runtime gets reset (e.g., due to inactivity), repeat steps 3, 4.\n", + "* After installation, if you want to activate/deactivate the GPU, you will need to reset the Runtime: _Runtime_ > _Factory reset runtime_ and repeat steps 2-4." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "cellView": "form", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "i_Ec54bF6mVj", + "outputId": "79bec2be-3986-4f80-a450-6e5edcf9a8c4" + }, + "outputs": [ + { + "data": { + "text/plain": [] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# @title Install C++ deps\n", + "%%shell\n", + "\n", + "sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "cellView": "form", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "45aDEOKc6JGW", + "outputId": "cd058f85-f376-4915-e9f5-825a9b51ad45" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[?25l\r\u001b[K |█▋ | 10 kB 35.4 MB/s eta 0:00:01\r\u001b[K |███▏ | 20 kB 32.4 MB/s eta 0:00:01\r\u001b[K |████▊ | 30 kB 19.6 MB/s eta 0:00:01\r\u001b[K |██████▎ | 40 kB 16.2 MB/s eta 0:00:01\r\u001b[K |███████▉ | 51 kB 8.9 MB/s eta 0:00:01\r\u001b[K |█████████▍ | 61 kB 9.2 MB/s eta 0:00:01\r\u001b[K |███████████ | 71 kB 8.8 MB/s eta 0:00:01\r\u001b[K |████████████▌ | 81 kB 9.6 MB/s eta 0:00:01\r\u001b[K |██████████████ | 92 kB 10.1 MB/s eta 0:00:01\r\u001b[K |███████████████▋ | 102 kB 8.4 MB/s eta 0:00:01\r\u001b[K |█████████████████▏ | 112 kB 8.4 MB/s eta 0:00:01\r\u001b[K |██████████████████▊ | 122 kB 8.4 MB/s eta 0:00:01\r\u001b[K |████████████████████▎ | 133 kB 8.4 MB/s eta 0:00:01\r\u001b[K |█████████████████████▉ | 143 kB 8.4 MB/s eta 0:00:01\r\u001b[K |███████████████████████▍ | 153 kB 8.4 MB/s eta 0:00:01\r\u001b[K |█████████████████████████ | 163 kB 8.4 MB/s eta 0:00:01\r\u001b[K |██████████████████████████▋ | 174 kB 8.4 MB/s eta 0:00:01\r\u001b[K |████████████████████████████▏ | 184 kB 8.4 MB/s eta 0:00:01\r\u001b[K |█████████████████████████████▊ | 194 kB 8.4 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▎| 204 kB 8.4 MB/s eta 0:00:01\r\u001b[K |████████████████████████████████| 209 kB 8.4 MB/s \n", + "\u001b[?25h Building wheel for ctypesgen (setup.py) ... \u001b[?25l\u001b[?25hdone\n" + ] + }, + { + "data": { + "text/plain": [] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# @title Install python deps\n", + "%%shell\n", + "\n", + "pip install -q contextlib2 pint simplejson ctypesgen==1.0.2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "cellView": "form", + "id": "WQL4Psci6S92" + }, + "outputs": [], + "source": [ + "# @title Build and Install Bifrost\n", + "%%shell\n", + "cd \"${HOME}\"\n", + "if [ -d \"${HOME}/bifrost_repo\" ]; then\n", + " echo \"Already cloned.\"\n", + "else\n", + " git clone https://github.com/ledatelescope/bifrost bifrost_repo\n", + "fi\n", + "cd \"${HOME}/bifrost_repo\"\n", + "git pull --all\n", + "\n", + "./configure\n", + "\n", + "# Build and install:\n", + "make -j all\n", + "sudo make install\n", + "export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Q8q8ZMix8kF6" + }, + "source": [ + "Now, let's create and test a pipeline:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "id": "YZOGJ-HhBAxg" + }, + "outputs": [], + "source": [ + "import os\n", + "\n", + "# Environment path doesn't propagate, so add it manually:\n", + "if \"/usr/local/lib\" not in os.environ['LD_LIBRARY_PATH']:\n", + " os.environ['LD_LIBRARY_PATH'] += \":/usr/local/lib\"\n", + "\n", + "import bifrost as bf\n", + "import numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "i2oRp6B1drwd" + }, + "source": [ + "Let's first create a simple CUDA kernel within Bifrost.\n", + "\n", + "We will generate 1000 integers, feed them into Bifrost as a CUDA array, perform a kernel operation `x * 3`, then copy them back." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "id": "yxm87l5acwIt" + }, + "outputs": [], + "source": [ + "x = np.random.randint(256, size=1000)\n", + "\n", + "x_orig = x\n", + "x = bf.asarray(x, 'cuda')\n", + "y = bf.empty_like(x)\n", + "x.flags['WRITEABLE'] = False\n", + "x.bf.immutable = True\n", + "for _ in range(3):\n", + " bf.map(\"y = x * 3\", {'x': x, 'y': y})\n", + "x = x.copy('system')\n", + "y = y.copy('system')\n", + "if isinstance(x_orig, bf.ndarray):\n", + " x_orig = x\n", + "np.testing.assert_equal(y, x_orig * 3)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "_jHnukaHdzUD" + }, + "source": [ + "Now, let's generate a full pipeline:" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "id": "E36NHJDzdyi9" + }, + "outputs": [], + "source": [ + "from bifrost.block import Pipeline, NumpyBlock, NumpySourceBlock\n", + "\n", + "def generate_different_arrays():\n", + " \"\"\"Yield four different groups of two arrays\"\"\"\n", + " dtypes = ['float32', 'float64', 'complex64', 'int8']\n", + " shapes = [(4,), (4, 5), (4, 5, 6), (2,) * 8]\n", + " for array_index in range(4):\n", + " yield np.ones(\n", + " shape=shapes[array_index],\n", + " dtype=dtypes[array_index])\n", + " yield 2 * np.ones(\n", + " shape=shapes[array_index],\n", + " dtype=dtypes[array_index])\n", + "\n", + "def switch_types(array):\n", + " \"\"\"Return two copies of the array, one with a different type\"\"\"\n", + " return np.copy(array), np.copy(array).astype(np.complex128)\n", + "\n", + "occurences = 0\n", + "def compare_arrays(array1, array2):\n", + " \"\"\"Make sure that all arrays coming in are equal\"\"\"\n", + " global occurences\n", + " occurences += 1\n", + " np.testing.assert_almost_equal(array1, array2)\n", + "\n", + "blocks = [\n", + " (NumpySourceBlock(generate_different_arrays), {'out_1': 0}),\n", + " (NumpyBlock(switch_types, outputs=2), {'in_1': 0, 'out_1': 1, 'out_2': 2}),\n", + " (NumpyBlock(np.fft.fft), {'in_1': 2, 'out_1': 3}),\n", + " (NumpyBlock(np.fft.ifft), {'in_1': 3, 'out_1': 4}),\n", + " (NumpyBlock(compare_arrays, inputs=2, outputs=0), {'in_1': 1, 'in_2': 4})]\n", + "\n", + "Pipeline(blocks).main()\n", + "\n", + "# The function `compare_arrays` should be hit 8 times:\n", + "assert occurences == 8" + ] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "collapsed_sections": [], + "name": "BifrostDemo.ipynb", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/CHANGELOG b/CHANGELOG index c324360ff..32072a898 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,28 @@ +0.10.1 + * Cleaned up the Makefile outputs + * Added a disk cache for bifrost.map calls + * Added support for configurable, reproducible builds with nix + * Added horizontal scrolling for long command names to like_bmon.py + * Use std::filesystem for where possible for file and directory management + * Fixed a problem in bifrost.ndarray.copy with arrays that are not C contiguous + * Added set_stream and get_stream to bifrost.device to help control which CUDA stream is used + * Added bifrost.device.ExternalStream as a context manager to help with mixing Bifrost and cupy/pycuda + * Fixed a problem calling bifrost.reduce on a slice of an array + * Added the astype() method to `bifrost.ndarray` + +0.10.0 + * Switched over to an autotools-based build system + * Added a .m4 file to help other autotools-based software find Bifrost + * Added a pkg-config file for Bifrost + * Made the Python API compatible with PEP479 + * Added support for the cuda_managed space on Pascal and later GPUs + * Added support for ci32 in bf.map + * Added support for converting a bifrost.ndarray to/from a cupy.ndarray + * Switched to ctypesgen 1.0.2 + * Added an example Python notebook that can run on Google Colab + * Added support for 'python -m bifrost.version' + * Removed bifrost_telemetry.py in favor of 'python -m bifrost.telemetry' + 0.9.1 * Fixed a problem with like_bmon.py crashing when there are a large number of pipelines * Added a CHANGELOG file diff --git a/Dockerfile.cpu b/Dockerfile.cpu index 0c640bf5d..c07f1740a 100644 --- a/Dockerfile.cpu +++ b/Dockerfile.cpu @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Update ctypesgen RUN pip --no-cache-dir install \ - git+https://github.com/olsonse/ctypesgen.git@9bd2d249aa4011c6383a10890ec6f203d7b7990f + ctypesgen==1.0.2 # Build the library WORKDIR /bifrost diff --git a/Dockerfile.gpu b/Dockerfile.gpu index e854d99b5..c67f144ba 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -30,7 +30,7 @@ RUN pip --no-cache-dir install \ contextlib2 \ simplejson \ pint \ - git+https://github.com/olsonse/ctypesgen.git@9bd2d249aa4011c6383a10890ec6f203d7b7990f \ + ctypesgen==1.0.2 \ graphviz ENV TERM xterm diff --git a/Dockerfile_prereq.gpu b/Dockerfile_prereq.gpu index 12f4e120d..ca8ca4e9c 100644 --- a/Dockerfile_prereq.gpu +++ b/Dockerfile_prereq.gpu @@ -29,7 +29,7 @@ RUN pip --no-cache-dir install \ contextlib2 \ simplejson \ pint \ - git+https://github.com/olsonse/ctypesgen.git@9bd2d249aa4011c6383a10890ec6f203d7b7990f \ + ctypesgen==1.0.2 \ graphviz ENV TERM xterm diff --git a/Makefile b/Makefile deleted file mode 100644 index 6ec05752c..000000000 --- a/Makefile +++ /dev/null @@ -1,87 +0,0 @@ - -include config.mk -include user.mk - -LIB_DIR = lib -INC_DIR = src -SRC_DIR = src - -BIFROST_PYTHON_DIR = python - -all: libbifrost python -.PHONY: all - -libbifrost: - $(MAKE) -C $(SRC_DIR) all -.PHONY: libbifrost - -test: - #$(MAKE) -C $(SRC_DIR) test - cd test && ./download_test_data.sh ; python -m unittest discover -.PHONY: test -clean: - $(MAKE) -C $(BIFROST_PYTHON_DIR) clean || true - $(MAKE) -C $(SRC_DIR) clean -.PHONY: clean -install: $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_INC_DIR)/$(BIFROST_NAME) - $(MAKE) -C $(BIFROST_PYTHON_DIR) install -.PHONY: install -uninstall: - rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO) - rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ) - rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) - rm -rf $(INSTALL_INC_DIR)/bifrost/ - $(MAKE) -C $(BIFROST_PYTHON_DIR) uninstall -.PHONY: uninstall - -doc: $(INC_DIR)/bifrost/*.h Doxyfile - $(DOXYGEN) Doxyfile -.PHONY: doc - -python: libbifrost - $(MAKE) -C $(BIFROST_PYTHON_DIR) build -.PHONY: python - -#GPU Docker build -IMAGE_NAME ?= ledatelescope/bifrost -docker: - docker build --pull -t $(IMAGE_NAME):$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile.gpu -t $(IMAGE_NAME) . -.PHONY: docker - -#GPU Docker prereq build -# (To be used for testing new builds rapidly) -IMAGE_NAME ?= ledatelescope/bifrost -docker_prereq: - docker build --pull -t $(IMAGE_NAME)_prereq:$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile_prereq.gpu -t $(IMAGE_NAME)_prereq . -.PHONY: docker_prereq - -#CPU-only Docker build -IMAGE_NAME ?= ledatelescope/bifrost -docker-cpu: - docker build --pull -t $(IMAGE_NAME):$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile.cpu -t $(IMAGE_NAME) . -.PHONY: docker - -# TODO: Consider adding a mode 'develop=1' that makes symlinks instead of copying -# the library and headers. - -DRY_RUN ?= 0 - -$(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN): $(LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) -ifeq ($(DRY_RUN),0) - cp $< $@ - ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO).$(LIBBIFROST_MAJOR) - ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO) -else - @echo "cp $< $@" - @echo "ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO).$(LIBBIFROST_MAJOR)" - @echo "ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO)" -endif - -$(INSTALL_INC_DIR)/bifrost: $(INC_DIR)/bifrost/*.h #$(INC_DIR)/bifrost/*.hpp -ifeq ($(DRY_RUN),0) - mkdir -p $@ - cp $? $@/ -else - @echo "mkdir -p $@" - @echo "cp $? $@/" -endif diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000..705df4208 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,142 @@ + +include config.mk + +LIB_DIR = lib +INC_DIR = src +DAT_DIR = share +SRC_DIR = src + +HAVE_PYTHON = @HAVE_PYTHON@ + +HAVE_DOCKER = @HAVE_DOCKER@ + +CAN_BUILD_CXX_DOCS = @HAVE_CXX_DOCS@ +CAN_BUILD_PYTHON_DOCS = @HAVE_PYTHON_DOCS@ + +BIFROST_PYTHON_DIR = python + +all: libbifrost python +.PHONY: all + +libbifrost: + $(MAKE) -C $(SRC_DIR) all +.PHONY: libbifrost + +check: +ifeq ($(HAVE_PYTHON),1) + MYPYPATH=$(BIFROST_PYTHON_DIR) mypy --follow-imports=silent \ + python/bifrost/blocks/detect.py \ + python/bifrost/blocks/quantize.py \ + python/bifrost/blocks/unpack.py \ + python/bifrost/sigproc.py \ + python/bifrost/sigproc2.py \ + test/test_sigproc.py \ + testbench/test_fft_detect.py +endif +.PHONY: check + +test: + #$(MAKE) -C $(SRC_DIR) test +ifeq ($(HAVE_PYTHON),1) + cd test && ./download_test_data.sh ; @PYTHON@ -m unittest discover -v +endif +.PHONY: test +clean: +ifeq ($(HAVE_PYTHON),1) + $(MAKE) -C $(BIFROST_PYTHON_DIR) clean || true +endif + $(MAKE) -C $(SRC_DIR) clean +.PHONY: clean +install: $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_INC_DIR)/$(BIFROST_NAME) $(INSTALL_DAT_DIR)/$(BIFROST_NAME) $(INSTALL_LIB_DIR)/pkgconfig +ifeq ($(HAVE_PYTHON),1) + $(MAKE) -C $(BIFROST_PYTHON_DIR) install +endif + @echo "Libraries have been installed in:" + @echo " $(INSTALL_LIB_DIR)" + @echo "" + @echo "If you ever happen to want to link against installed libraries" + @echo "in a given directory, LIBDIR, you must either use libtool, and" + @echo "specify the full pathname of the library, or use the '-LLIBDIR'" + @echo "flag during linking and do at least one of the following:" + @echo " - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable" + @echo " during execution" + @echo " - add LIBDIR to the 'LD_RUN_PATH' environment variable" + @echo " during linking" + @echo " - use the '-Wl,-rpath -Wl,LIBDIR' linker flag" + @echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + @echo "" + @echo "See any operating system documentation about shared libraries for" + @echo "more information, such as the ld(1) and ld.so(8) manual pages." +.PHONY: install +uninstall: + rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO) + rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ) + rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) + rm -rf $(INSTALL_INC_DIR)/bifrost/ + rm -rf $(INSTALL_DAT_DIR)/bifrost/ + rm -f $(INSTALL_LIB_DIR)/pkgconfig/bifrost.pc +ifeq ($(HAVE_PYTHON),1) + $(MAKE) -C $(BIFROST_PYTHON_DIR) uninstall +endif +.PHONY: uninstall + +doc: $(INC_DIR)/bifrost/*.h Doxyfile docs/source/*.rst docs/source/*.py +ifeq ($(CAN_BUILD_CXX_DOCS),1) + @DX_DOXYGEN@ Doxyfile +endif +ifeq ($(CAN_BUILD_PYTHON_DOCS),1) + $(MAKE) -C docs singlehtml +endif +.PHONY: doc + +python: libbifrost +ifeq ($(HAVE_PYTHON),1) + $(MAKE) -C $(BIFROST_PYTHON_DIR) build +endif +.PHONY: python + +#GPU Docker build +IMAGE_NAME ?= ledatelescope/bifrost +docker: +ifeq ($(HAVE_DOCKER),1) + docker build --pull -t $(IMAGE_NAME):$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile.gpu -t $(IMAGE_NAME) . +endif +.PHONY: docker + +#GPU Docker prereq build +# (To be used for testing new builds rapidly) +IMAGE_NAME ?= ledatelescope/bifrost +docker_prereq: +ifeq ($(HAVE_DOCKER),1) + docker build --pull -t $(IMAGE_NAME)_prereq:$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile_prereq.gpu -t $(IMAGE_NAME)_prereq . +endif +.PHONY: docker_prereq + +#CPU-only Docker build +IMAGE_NAME ?= ledatelescope/bifrost +docker-cpu: +ifeq ($(HAVE_DOCKER),1) + docker build --pull -t $(IMAGE_NAME):$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile.cpu -t $(IMAGE_NAME) . +endif +.PHONY: docker + +# TODO: Consider adding a mode 'develop=1' that makes symlinks instead of copying +# the library and headers. + +$(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN): $(LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) + mkdir -p $(INSTALL_LIB_DIR) + cp $< $@ + ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO).$(LIBBIFROST_MAJOR) + ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO) + +$(INSTALL_INC_DIR)/bifrost: $(INC_DIR)/bifrost/*.h #$(INC_DIR)/bifrost/*.hpp + mkdir -p $@ + cp $? $@/ + +$(INSTALL_DAT_DIR)/bifrost: $(DAT_DIR)/*.m4 + mkdir -p $@ + cp $? $@/ + +$(INSTALL_LIB_DIR)/pkgconfig: $(DAT_DIR)/*.pc + mkdir -p $@ + cp $? $@/ diff --git a/README.md b/README.md index adb2b30d9..feda6c0d3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,19 @@ # Bifrost -| **`CPU Build`** | **`GPU Build`** | **`Coverage`** | -|-----------------|-----------------|----------------| -|[![Travis](https://travis-ci.com/ledatelescope/bifrost.svg?branch=master)](https://travis-ci.com/ledatelescope/bifrost) | [![Build Status](https://fornax.phys.unm.edu/jenkins/buildStatus/icon?job=Bifrost)](https://fornax.phys.unm.edu/jenkins/job/Bifrost/) | [![Coverage Status](https://coveralls.io/repos/github/ledatelescope/bifrost/badge.svg)](https://coveralls.io/github/ledatelescope/bifrost) | +| **`CPU/GPU Build`** | **`Coverage`** | +|-----------------|----------------| +|[![GHA](https://github.com/ledatelescope/bifrost/actions/workflows/main.yml/badge.svg)](https://github.com/ledatelescope/bifrost/actions/workflows/main.yml) | [![Coverage Status](https://codecov.io/gh/ledatelescope/bifrost/branch/master/graph/badge.svg?token=f3ge1zWe5P)](https://codecov.io/gh/ledatelescope/bifrost) | A stream processing framework for high-throughput applications. ### [![Paper](https://img.shields.io/badge/arXiv-1708.00720-blue.svg)](https://arxiv.org/abs/1708.00720) ### [Bifrost Documentation](http://ledatelescope.github.io/bifrost/) + +See also the [Bifrost tutorial notebooks](tutorial/), which can be run +on Google Colab or any Jupyter environment where Bifrost is installed +(and a GPU is available). + ### [Bifrost Roadmap](ROADMAP.md) ## A Simple Pipeline @@ -87,10 +92,23 @@ print "All done" ## Installation +**For a quick demo which you can run in-browser without installation, +go to the following [link](https://colab.research.google.com/github/ledatelescope/bifrost/blob/master/BifrostDemo.ipynb).** + +### CUDA + +CUDA is available at https://developer.nvidia.com/cuda-downloads. You can check the +["Getting Started guide"](http://ledatelescope.github.io/bifrost/Getting-started-guide.html) +in the docs to see which versions of the CUDA toolkit have been confirmed to work with Bifrost. + ### C Dependencies +If using Ubuntu or another Debian-based linux distribution: + $ sudo apt-get install exuberant-ctags +Otherwise check https://ctags.sourceforge.net/ for install instructions. + ### Python Dependencies * numpy @@ -99,22 +117,27 @@ print "All done" * ctypesgen ``` -$ sudo pip install numpy contextlib2 pint git+https://github.com/olsonse/ctypesgen.git@9bd2d249aa4011c6383a10890ec6f203d7b7990f +$ sudo pip install numpy contextlib2 pint ctypesgen==1.0.2 ``` ### Bifrost Installation -Edit **user.mk** to suit your system, then run: +To configure Bifrost for you your system and build the library, then run: + $ ./configure $ make -j $ sudo make install -which will install the library and headers into /usr/local/lib and -/usr/local/include respectively. +By default this will install the library and headers into /usr/local/lib and +/usr/local/include respectively. You can use the --prefix option to configure +to change this. You can call the following for a local Python installation: - $ sudo make install PYINSTALLFLAGS="--prefix=$HOME/usr/local" + $ ./configure --with-pyinstall-flags=--user + $ make -j + $ sudo make install HAVE_PYTHON=0 + $ make -C python install ### Docker Container @@ -158,8 +181,17 @@ your machine. ### Building the Docs from Scratch -Install sphinx and breathe using pip, and also install Doxygen. +Install breathe using pip: + $ sudo pip install breathe sphinx + +Also install Doxygen using your package manager. +In Ubuntu, for example: + + $ sudo apt-get install doxygen + +Otherwise check https://www.doxygen.nl/ for Doxygen install instructions. + Doxygen documentation can be generated by running: $ make doc @@ -188,15 +220,8 @@ they are aggregated. Users can opt out of telemetry collection using: -```python -from bifrost import telemetry -telemetry.disable() -``` - -or by using the included `bifrost_telemetry.py` script: - ``` -python bifrost_telemetry.py --disable +python -m bifrost.telemetry --disable ``` This command will set a disk-based flag that disables the reporting process. diff --git a/ROADMAP.md b/ROADMAP.md index 0489e81f9..cd3b80c1c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -11,16 +11,23 @@ stated, the items on this page have not yet been developed. * Harmonic summing, folding * Calibration and imaging algorithms * Gridding/degridding, compressive sensing, CLEAN - * IO (source/sink) blocks for additional astronomy/audio/generic file formats + * I/O (source/sink) blocks for additional astronomy/audio/generic file formats ## Pipeline features + * Method of sending data between different servers * Remote control mechanisms * Pipeline status and performance monitoring * Streaming data visualisation ## Backend features + * Improved packet capture/transmission framework + * Support for InfiniBand verbs * CPU backends for existing CUDA-only algorithms * Support for inter-process shared memory rings * Optimisations for low-latency applications + +## Platform and dependency updates + + * Python 2.x will no longer be supported after the end of 2022. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..6c5021390 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +# https://docs.codecov.com/docs/fixing-paths +fixes: + - "/home/docker/actions-runner/_work/_tool/Python/3.*/x64/lib/python3.*/site-packages/::python/" diff --git a/config.mk b/config.mk.in similarity index 64% rename from config.mk rename to config.mk.in index 4ca448915..cff27d162 100644 --- a/config.mk +++ b/config.mk.in @@ -1,4 +1,3 @@ - ifndef OS OS := $(shell uname -s) endif @@ -8,7 +7,7 @@ ifeq ($(OS),Linux) SHARED_FLAG = -shared SONAME_FLAG = -soname else ifeq ($(OS),Darwin) - SO_EXT = .dylib + SO_EXT = .dylib SHARED_FLAG = -dynamiclib SONAME_FLAG = -install_name #else ifeq ($(OS),Windows_NT) @@ -17,19 +16,18 @@ else $(error Unsupported OS) endif -ifndef INSTALL_LIB_DIR - INSTALL_LIB_DIR = /usr/local/lib -endif -ifndef INSTALL_INC_DIR - INSTALL_INC_DIR = /usr/local/include -endif +prefix = @prefix@ +exec_prefix = @exec_prefix@ +INSTALL_LIB_DIR = @libdir@ +INSTALL_INC_DIR = @includedir@ +INSTALL_DAT_DIR = @datarootdir@ BIFROST_NAME = bifrost LIBBIFROST_NAME = lib$(BIFROST_NAME) -LIBBIFROST_MAJOR = 0 -LIBBIFROST_MINOR = 9 -LIBBIFROST_PATCH = 0 +LIBBIFROST_MAJOR = @PACKAGE_VERSION_MAJOR@ +LIBBIFROST_MINOR = @PACKAGE_VERSION_MINOR@ +LIBBIFROST_PATCH = @PACKAGE_VERSION_MICRO@ LIBBIFROST_SO = $(LIBBIFROST_NAME)$(SO_EXT) LIBBIFROST_SO_MAJ = $(LIBBIFROST_SO).$(LIBBIFROST_MAJOR) LIBBIFROST_SO_MAJ_MIN = $(LIBBIFROST_SO_MAJ).$(LIBBIFROST_MINOR) diff --git a/config/config.guess b/config/config.guess new file mode 100755 index 000000000..d622a44e5 --- /dev/null +++ b/config/config.guess @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config/config.sub b/config/config.sub new file mode 100755 index 000000000..c894da455 --- /dev/null +++ b/config/config.sub @@ -0,0 +1,1773 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config/cuda.m4 b/config/cuda.m4 new file mode 100644 index 000000000..92feabe94 --- /dev/null +++ b/config/cuda.m4 @@ -0,0 +1,352 @@ +AC_DEFUN([AX_CHECK_CUDA], +[ + AC_PROVIDE([AX_CHECK_CUDA]) + AC_ARG_WITH([cuda_home], + [AS_HELP_STRING([--with-cuda-home], + [CUDA install path (default=/usr/local/cuda)])], + [], + [with_cuda_home=/usr/local/cuda]) + AC_SUBST(CUDA_HOME, $with_cuda_home) + + AC_ARG_ENABLE([cuda], + [AS_HELP_STRING([--disable-cuda], + [disable cuda support (default=no)])], + [enable_cuda=no], + [enable_cuda=yes]) + + NVCCLIBS="" + ac_compile_save="$ac_compile" + ac_link_save="$ac_link" + ac_run_save="$ac_run" + + AC_SUBST([HAVE_CUDA], [0]) + AC_SUBST([CUDA_VERSION], [0]) + AC_SUBST([CUDA_HAVE_CXX20], [0]) + AC_SUBST([CUDA_HAVE_CXX17], [0]) + AC_SUBST([CUDA_HAVE_CXX14], [0]) + AC_SUBST([CUDA_HAVE_CXX11], [0]) + AC_SUBST([GPU_MIN_ARCH], [0]) + AC_SUBST([GPU_MAX_ARCH], [0]) + AC_SUBST([GPU_SHAREDMEM], [0]) + AC_SUBST([GPU_PASCAL_MANAGEDMEM], [0]) + AC_SUBST([GPU_EXP_PINNED_ALLOC], [1]) + if test "$enable_cuda" != "no"; then + AC_SUBST([HAVE_CUDA], [1]) + + AC_PATH_PROG(NVCC, nvcc, no, [$CUDA_HOME/bin:$PATH]) + AC_PATH_PROG(NVPRUNE, nvprune, no, [$CUDA_HOME/bin:$PATH]) + AC_PATH_PROG(CUOBJDUMP, cuobjdump, no, [$CUDA_HOME/bin:$PATH]) + fi + + if test "$HAVE_CUDA" = "1"; then + AC_MSG_CHECKING([for a working CUDA 10+ installation]) + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="$LIBS -lcuda -lcudart" + ac_ext="cu" + + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include ]], + [[cudaMalloc(0, 0);]])], + [], + [AC_SUBST([HAVE_CUDA], [0])]) + + if test "$HAVE_CUDA" = "1"; then + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="$NVCCLIBS -lcuda -lcudart" + + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS $NVCCLIBS conftest.$ac_ext >&5' + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include ]], + [[cudaMalloc(0, 0);]])], + [CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) + AC_MSG_RESULT(yes - v$CUDA_VERSION)], + [AC_MSG_RESULT(no) + AC_SUBST([HAVE_CUDA], [0])]) + else + AC_MSG_RESULT(no) + AC_SUBST([HAVE_CUDA], [0]) + fi + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + fi + + if test "$HAVE_CUDA" = "1"; then + AC_MSG_CHECKING([for CUDA CXX standard support]) + + CUDA_STDCXX=$( ${NVCC} --help | ${GREP} -Po -e "--std.*}" | ${SED} 's/.*|//;s/}//;' ) + if test "$CUDA_STDCXX" = "c++20"; then + AC_MSG_RESULT(C++20) + AC_SUBST([CUDA_HAVE_CXX20], [1]) + else + if test "$CUDA_STDCXX" = "c++17"; then + AC_MSG_RESULT(C++17) + AC_SUBST([CUDA_HAVE_CXX17], [1]) + else + if test "$CUDA_STDCXX" = "c++14"; then + AC_MSG_RESULT(C++14) + AC_SUBST([CUDA_HAVE_CXX14], [1]) + else + if test "$CUDA_STDCXX" = "c++11"; then + AC_MSG_RESULT(C++11) + AC_SUBST([CUDA_HAVE_CXX11], [1]) + else + AC_MSG_ERROR(nvcc does not support at least C++11) + fi + fi + fi + fi + fi + + AC_ARG_WITH([nvcc_flags], + [AS_HELP_STRING([--with-nvcc-flags], + [flags to pass to NVCC (default='-O3 -Xcompiler "-Wall"')])], + [], + [with_nvcc_flags='-O3 -Xcompiler "-Wall"']) + AC_SUBST(NVCCFLAGS, $with_nvcc_flags) + + AC_ARG_WITH([stream_model], + [AS_HELP_STRING([--with-stream-model], + [CUDA default stream model to use: 'legacy' or 'per-thread' (default='per-thread')])], + [], + [with_stream_model='per-thread']) + + + if test "$HAVE_CUDA" = "1"; then + AC_MSG_CHECKING([for different CUDA default stream models]) + dsm_supported=$( ${NVCC} -h | ${GREP} -Po -e "--default-stream" ) + if test "$dsm_supported" = "--default-stream"; then + if test "$with_stream_model" = "per-thread"; then + NVCCFLAGS="$NVCCFLAGS -default-stream per-thread" + AC_MSG_RESULT([yes, using 'per-thread']) + else + if test "$with_stream_model" = "legacy"; then + NVCCFLAGS="$NVCCFLAGS -default-stream legacy" + AC_MSG_RESULT([yes, using 'legacy']) + else + AC_MSG_ERROR(Invalid CUDA stream model: '$with_stream_model') + fi + fi + else + AC_MSG_RESULT([no, only the 'legacy' stream model is supported]) + fi + fi + + if test "$HAVE_CUDA" = "1"; then + CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" + CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" + NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" + LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="$NVCCLIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" + fi + + AC_ARG_WITH([gpu_archs], + [AS_HELP_STRING([--with-gpu-archs=...], + [default GPU architectures (default=detect)])], + [], + [with_gpu_archs='auto']) + if test "$HAVE_CUDA" = "1"; then + AC_MSG_CHECKING([for valid CUDA architectures]) + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[[0-9]]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_supported_flat=$( echo $ar_supported | xargs ) + AC_MSG_RESULT(found: $ar_supported_flat) + + if test "$with_gpu_archs" = "auto"; then + AC_MSG_CHECKING([which CUDA architectures to target]) + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="-lcuda -lcudart" + ax_ext="cu" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS $NVCCLIBS conftest.$ac_ext>&5' + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include + #include + #include + #include ]], + [[ + std::set archs; + int major, minor, arch; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + std::ofstream fh; + fh.open("confarchs.out"); + for(int dev=0; dev 0 ) { + fh << " "; + } + fh << arch; + } + arch += minor; + if( archs.count(arch) == 0 ) { + archs.insert(arch); + fh << " " << arch; + } + } + fh.close();]])], + [AC_SUBST([GPU_ARCHS], [`cat confarchs.out`]) + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[[0-9]]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + if test "$ar_valid" = ""; then + AC_MSG_ERROR(failed to find any supported) + else + AC_SUBST([GPU_ARCHS], [$ar_valid]) + AC_MSG_RESULT([$GPU_ARCHS]) + fi], + [AC_MSG_ERROR(failed to find any)]) + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + else + AC_SUBST([GPU_ARCHS], [$with_gpu_archs]) + fi + + AC_MSG_CHECKING([for valid requested CUDA architectures]) + ar_requested=$( echo "$GPU_ARCHS" | wc -w ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + ar_found=$( echo $ar_valid | wc -w ) + if test "$ar_requested" = "$ar_found"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR(only '$ar_valid' are supported) + fi + + ar_min_valid=$(echo $ar_valid | ${SED} -e 's/ .*//g;' ) + AC_SUBST([GPU_MIN_ARCH], [$ar_min_valid]) + ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) + AC_SUBST([GPU_MAX_ARCH], [$ar_max_valid]) + + AC_ARG_WITH([shared_mem], + [AS_HELP_STRING([--with-shared-mem=N], + [default GPU shared memory per block in bytes (default=detect)])], + [], + [with_shared_mem='auto']) + if test "$with_shared_mem" = "auto"; then + AC_MSG_CHECKING([for minimum shared memory per block]) + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="-lcuda -lcudart" + ac_ext="cu" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include + #include + #include + #include ]], + [[ + std::set smem; + int smemSize; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + for(int dev=0; dev + #include + #include ]], + [[]])], + [AC_SUBST([GPU_EXP_PINNED_ALLOC], [0]) + AC_MSG_RESULT([full])], + [AC_SUBST([GPU_EXP_PINNED_ALLOC], [1]) + AC_MSG_RESULT([experimental])]) + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + else + AC_SUBST([GPU_PASCAL_MANAGEDMEM], [0]) + AC_SUBST([GPU_EXP_PINNED_ALLOC], [1]) + fi + + ac_compile="$ac_compile_save" + ac_link="$ac_link_save" + ac_run="$ac_run_save" +]) diff --git a/config/doxygen.m4 b/config/doxygen.m4 new file mode 100644 index 000000000..ed1dc83b4 --- /dev/null +++ b/config/doxygen.m4 @@ -0,0 +1,586 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html +# =========================================================================== +# +# SYNOPSIS +# +# DX_INIT_DOXYGEN(PROJECT-NAME, [DOXYFILE-PATH], [OUTPUT-DIR], ...) +# DX_DOXYGEN_FEATURE(ON|OFF) +# DX_DOT_FEATURE(ON|OFF) +# DX_HTML_FEATURE(ON|OFF) +# DX_CHM_FEATURE(ON|OFF) +# DX_CHI_FEATURE(ON|OFF) +# DX_MAN_FEATURE(ON|OFF) +# DX_RTF_FEATURE(ON|OFF) +# DX_XML_FEATURE(ON|OFF) +# DX_PDF_FEATURE(ON|OFF) +# DX_PS_FEATURE(ON|OFF) +# +# DESCRIPTION +# +# The DX_*_FEATURE macros control the default setting for the given +# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for +# generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML +# help (for MS users), 'CHI' for generating a separate .chi file by the +# .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate +# output formats. The environment variable DOXYGEN_PAPER_SIZE may be +# specified to override the default 'a4wide' paper size. +# +# By default, HTML, PDF and PS documentation is generated as this seems to +# be the most popular and portable combination. MAN pages created by +# Doxygen are usually problematic, though by picking an appropriate subset +# and doing some massaging they might be better than nothing. CHM and RTF +# are specific for MS (note that you can't generate both HTML and CHM at +# the same time). The XML is rather useless unless you apply specialized +# post-processing to it. +# +# The macros mainly control the default state of the feature. The use can +# override the default by specifying --enable or --disable. The macros +# ensure that contradictory flags are not given (e.g., +# --enable-doxygen-html and --enable-doxygen-chm, +# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each +# feature will be automatically disabled (with a warning) if the required +# programs are missing. +# +# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN +# with the following parameters: a one-word name for the project for use +# as a filename base etc., an optional configuration file name (the +# default is '$(srcdir)/Doxyfile', the same as Doxygen's default), and an +# optional output directory name (the default is 'doxygen-doc'). To run +# doxygen multiple times for different configuration files and output +# directories provide more parameters: the second, forth, sixth, etc +# parameter are configuration file names and the third, fifth, seventh, +# etc parameter are output directories. No checking is done to catch +# duplicates. +# +# Automake Support +# +# The DX_RULES substitution can be used to add all needed rules to the +# Makefile. Note that this is a substitution without being a variable: +# only the @DX_RULES@ syntax will work. +# +# The provided targets are: +# +# doxygen-doc: Generate all doxygen documentation. +# +# doxygen-run: Run doxygen, which will generate some of the +# documentation (HTML, CHM, CHI, MAN, RTF, XML) +# but will not do the post processing required +# for the rest of it (PS, PDF). +# +# doxygen-ps: Generate doxygen PostScript documentation. +# +# doxygen-pdf: Generate doxygen PDF documentation. +# +# Note that by default these are not integrated into the automake targets. +# If doxygen is used to generate man pages, you can achieve this +# integration by setting man3_MANS to the list of man pages generated and +# then adding the dependency: +# +# $(man3_MANS): doxygen-doc +# +# This will cause make to run doxygen and generate all the documentation. +# +# The following variable is intended for use in Makefile.am: +# +# DX_CLEANFILES = everything to clean. +# +# Then add this variable to MOSTLYCLEANFILES. +# +# LICENSE +# +# Copyright (c) 2009 Oren Ben-Kiki +# Copyright (c) 2015 Olaf Mandel +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 24 + +## ----------## +## Defaults. ## +## ----------## + +DX_ENV="" +AC_DEFUN([DX_FEATURE_doc], ON) +AC_DEFUN([DX_FEATURE_dot], OFF) +AC_DEFUN([DX_FEATURE_man], OFF) +AC_DEFUN([DX_FEATURE_html], ON) +AC_DEFUN([DX_FEATURE_chm], OFF) +AC_DEFUN([DX_FEATURE_chi], OFF) +AC_DEFUN([DX_FEATURE_rtf], OFF) +AC_DEFUN([DX_FEATURE_xml], OFF) +AC_DEFUN([DX_FEATURE_pdf], ON) +AC_DEFUN([DX_FEATURE_ps], ON) + +## --------------- ## +## Private macros. ## +## --------------- ## + +# DX_ENV_APPEND(VARIABLE, VALUE) +# ------------------------------ +# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen and add it +# as a substitution (but not a Makefile variable). The substitution +# is skipped if the variable name is VERSION. +AC_DEFUN([DX_ENV_APPEND], +[AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])dnl +m4_if([$1], [VERSION], [], [AC_SUBST([$1], [$2])dnl +AM_SUBST_NOTMAKE([$1])])dnl +]) + +# DX_DIRNAME_EXPR +# --------------- +# Expand into a shell expression prints the directory part of a path. +AC_DEFUN([DX_DIRNAME_EXPR], + [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) + +# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) +# ------------------------------------- +# Expands according to the M4 (static) status of the feature. +AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) + +# DX_REQUIRE_PROG(VARIABLE, PROGRAM) +# ---------------------------------- +# Require the specified program to be found for the DX_CURRENT_FEATURE to work. +AC_DEFUN([DX_REQUIRE_PROG], [ +AC_PATH_TOOL([$1], [$2]) +if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then + AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) + AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) +fi +]) + +# DX_TEST_FEATURE(FEATURE) +# ------------------------ +# Expand to a shell expression testing whether the feature is active. +AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) + +# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) +# ------------------------------------------------- +# Verify that a required features has the right state before trying to turn on +# the DX_CURRENT_FEATURE. +AC_DEFUN([DX_CHECK_DEPEND], [ +test "$DX_FLAG_$1" = "$2" \ +|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, + requires, contradicts) doxygen-$1]) +]) + +# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) +# ---------------------------------------------------------- +# Turn off the DX_CURRENT_FEATURE if the required feature is off. +AC_DEFUN([DX_CLEAR_DEPEND], [ +test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) +]) + +# DX_FEATURE_ARG(FEATURE, DESCRIPTION, +# CHECK_DEPEND, CLEAR_DEPEND, +# REQUIRE, DO-IF-ON, DO-IF-OFF) +# -------------------------------------------- +# Parse the command-line option controlling a feature. CHECK_DEPEND is called +# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), +# otherwise CLEAR_DEPEND is called to turn off the default state if a required +# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional +# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and +# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. +AC_DEFUN([DX_ARG_ABLE], [ + AC_DEFUN([DX_CURRENT_FEATURE], [$1]) + AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) + AC_ARG_ENABLE(doxygen-$1, + [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], + [--enable-doxygen-$1]), + DX_IF_FEATURE([$1], [don't $2], [$2]))], + [ +case "$enableval" in +#( +y|Y|yes|Yes|YES) + AC_SUBST([DX_FLAG_$1], 1) + $3 +;; #( +n|N|no|No|NO) + AC_SUBST([DX_FLAG_$1], 0) +;; #( +*) + AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) +;; +esac +], [ +AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) +$4 +]) +if DX_TEST_FEATURE([$1]); then + $5 + : +fi +if DX_TEST_FEATURE([$1]); then + $6 + : +else + $7 + : +fi +]) + +## -------------- ## +## Public macros. ## +## -------------- ## + +# DX_XXX_FEATURE(DEFAULT_STATE) +# ----------------------------- +AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) +AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])]) +AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) +AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) +AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) +AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) +AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) +AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) +AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) + +# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR], ...) +# -------------------------------------------------------------- +# PROJECT also serves as the base name for the documentation files. +# The default CONFIG-FILE is "$(srcdir)/Doxyfile" and OUTPUT-DOC-DIR is +# "doxygen-doc". +# More arguments are interpreted as interleaved CONFIG-FILE and +# OUTPUT-DOC-DIR values. +AC_DEFUN([DX_INIT_DOXYGEN], [ + +# Files: +AC_SUBST([DX_PROJECT], [$1]) +AC_SUBST([DX_CONFIG], ['ifelse([$2], [], [$(srcdir)/Doxyfile], [$2])']) +AC_SUBST([DX_DOCDIR], ['ifelse([$3], [], [doxygen-doc], [$3])']) +m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 4, m4_count($@), 2, + [AC_SUBST([DX_CONFIG]m4_eval(DX_i[/2]), + 'm4_default_nblank_quoted(m4_argn(DX_i, $@), + [$(srcdir)/Doxyfile])')])])dnl +m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 5, m4_count($@,), 2, + [AC_SUBST([DX_DOCDIR]m4_eval([(]DX_i[-1)/2]), + 'm4_default_nblank_quoted(m4_argn(DX_i, $@), + [doxygen-doc])')])])dnl +m4_define([DX_loop], m4_dquote(m4_if(m4_eval(3 < m4_count($@)), 1, + [m4_for([DX_i], 4, m4_count($@), 2, [, m4_eval(DX_i[/2])])], + [])))dnl + +# Environment variables used inside doxygen.cfg: +DX_ENV_APPEND(SRCDIR, $srcdir) +DX_ENV_APPEND(PROJECT, $DX_PROJECT) +DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) + +# Doxygen itself: +DX_ARG_ABLE(doc, [generate any doxygen documentation], + [], + [], + [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) + DX_REQUIRE_PROG([DX_PERL], perl)], + [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) + +# Dot for graphics: +DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_DOT], dot)], + [DX_ENV_APPEND(HAVE_DOT, YES) + DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], + [DX_ENV_APPEND(HAVE_DOT, NO)]) + +# Man pages generation: +DX_ARG_ABLE(man, [generate doxygen manual pages], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_MAN, YES)], + [DX_ENV_APPEND(GENERATE_MAN, NO)]) + +# RTF file generation: +DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_RTF, YES)], + [DX_ENV_APPEND(GENERATE_RTF, NO)]) + +# XML file generation: +DX_ARG_ABLE(xml, [generate doxygen XML documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_XML, YES)], + [DX_ENV_APPEND(GENERATE_XML, NO)]) + +# (Compressed) HTML help generation: +DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_HHC], hhc)], + [DX_ENV_APPEND(HHC_PATH, $DX_HHC) + DX_ENV_APPEND(GENERATE_HTML, YES) + DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], + [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) + +# Separate CHI file generation. +DX_ARG_ABLE(chi, [generate doxygen separate compressed HTML help index file], + [DX_CHECK_DEPEND(chm, 1)], + [DX_CLEAR_DEPEND(chm, 1)], + [], + [DX_ENV_APPEND(GENERATE_CHI, YES)], + [DX_ENV_APPEND(GENERATE_CHI, NO)]) + +# Plain HTML pages generation: +DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], + [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], + [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], + [], + [DX_ENV_APPEND(GENERATE_HTML, YES)], + [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) + +# PostScript file generation: +DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_LATEX], latex) + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) + DX_REQUIRE_PROG([DX_DVIPS], dvips) + DX_REQUIRE_PROG([DX_EGREP], egrep)]) + +# PDF file generation: +DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) + DX_REQUIRE_PROG([DX_EGREP], egrep)]) + +# LaTeX generation for PS and/or PDF: +if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then + DX_ENV_APPEND(GENERATE_LATEX, YES) +else + DX_ENV_APPEND(GENERATE_LATEX, NO) +fi + +# Paper size for PS and/or PDF: +AC_ARG_VAR(DOXYGEN_PAPER_SIZE, + [a4wide (default), a4, letter, legal or executive]) +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + AC_SUBST(DOXYGEN_PAPER_SIZE, "") +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) +;; #( +*) + AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) +;; +esac + +# Rules: +AS_IF([[test $DX_FLAG_html -eq 1]], +[[DX_SNIPPET_html="## ------------------------------- ## +## Rules specific for HTML output. ## +## ------------------------------- ## + +DX_CLEAN_HTML = \$(DX_DOCDIR)/html]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/html]])[ + +"]], +[[DX_SNIPPET_html=""]]) +AS_IF([[test $DX_FLAG_chi -eq 1]], +[[DX_SNIPPET_chi=" +DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).chi]])["]], +[[DX_SNIPPET_chi=""]]) +AS_IF([[test $DX_FLAG_chm -eq 1]], +[[DX_SNIPPET_chm="## ------------------------------ ## +## Rules specific for CHM output. ## +## ------------------------------ ## + +DX_CLEAN_CHM = \$(DX_DOCDIR)/chm]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/chm]])[\ +${DX_SNIPPET_chi} + +"]], +[[DX_SNIPPET_chm=""]]) +AS_IF([[test $DX_FLAG_man -eq 1]], +[[DX_SNIPPET_man="## ------------------------------ ## +## Rules specific for MAN output. ## +## ------------------------------ ## + +DX_CLEAN_MAN = \$(DX_DOCDIR)/man]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/man]])[ + +"]], +[[DX_SNIPPET_man=""]]) +AS_IF([[test $DX_FLAG_rtf -eq 1]], +[[DX_SNIPPET_rtf="## ------------------------------ ## +## Rules specific for RTF output. ## +## ------------------------------ ## + +DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/rtf]])[ + +"]], +[[DX_SNIPPET_rtf=""]]) +AS_IF([[test $DX_FLAG_xml -eq 1]], +[[DX_SNIPPET_xml="## ------------------------------ ## +## Rules specific for XML output. ## +## ------------------------------ ## + +DX_CLEAN_XML = \$(DX_DOCDIR)/xml]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/xml]])[ + +"]], +[[DX_SNIPPET_xml=""]]) +AS_IF([[test $DX_FLAG_ps -eq 1]], +[[DX_SNIPPET_ps="## ----------------------------- ## +## Rules specific for PS output. ## +## ----------------------------- ## + +DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).ps]])[ + +DX_PS_GOAL = doxygen-ps + +doxygen-ps: \$(DX_CLEAN_PS) + +]m4_foreach([DX_i], [DX_loop], +[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).ps: \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR]DX_i[)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_LATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_LATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_LATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi + +]])["]], +[[DX_SNIPPET_ps=""]]) +AS_IF([[test $DX_FLAG_pdf -eq 1]], +[[DX_SNIPPET_pdf="## ------------------------------ ## +## Rules specific for PDF output. ## +## ------------------------------ ## + +DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).pdf]])[ + +DX_PDF_GOAL = doxygen-pdf + +doxygen-pdf: \$(DX_CLEAN_PDF) + +]m4_foreach([DX_i], [DX_loop], +[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).pdf: \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR]DX_i[)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_PDFLATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + mv refman.pdf ../\$(PACKAGE).pdf + +]])["]], +[[DX_SNIPPET_pdf=""]]) +AS_IF([[test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1]], +[[DX_SNIPPET_latex="## ------------------------------------------------- ## +## Rules specific for LaTeX (shared for PS and PDF). ## +## ------------------------------------------------- ## + +DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) +_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_LATEX_0 = @echo \" LATEX \" \$][@; + +DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/latex]])[ + +"]], +[[DX_SNIPPET_latex=""]]) + +AS_IF([[test $DX_FLAG_doc -eq 1]], +[[DX_SNIPPET_doc="## --------------------------------- ## +## Format-independent Doxygen rules. ## +## --------------------------------- ## + +${DX_SNIPPET_html}\ +${DX_SNIPPET_chm}\ +${DX_SNIPPET_man}\ +${DX_SNIPPET_rtf}\ +${DX_SNIPPET_xml}\ +${DX_SNIPPET_ps}\ +${DX_SNIPPET_pdf}\ +${DX_SNIPPET_latex}\ +DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) +_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; + +.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +doxygen-run:]m4_foreach([DX_i], [DX_loop], + [[ \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag]])[ + +doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +]m4_foreach([DX_i], [DX_loop], +[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag: \$(DX_CONFIG]DX_i[) \$(pkginclude_HEADERS) + \$(A""M_V_at)rm -rf \$(DX_DOCDIR]DX_i[) + \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR]DX_i[) \$(DX_DOXYGEN) \$(DX_CONFIG]DX_i[) + \$(A""M_V_at)echo Timestamp >\$][@ + +]])dnl +[DX_CLEANFILES = \\] +m4_foreach([DX_i], [DX_loop], +[[ \$(DX_DOCDIR]DX_i[)/doxygen_sqlite3.db \\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag \\ +]])dnl +[ -r \\ + \$(DX_CLEAN_HTML) \\ + \$(DX_CLEAN_CHM) \\ + \$(DX_CLEAN_CHI) \\ + \$(DX_CLEAN_MAN) \\ + \$(DX_CLEAN_RTF) \\ + \$(DX_CLEAN_XML) \\ + \$(DX_CLEAN_PS) \\ + \$(DX_CLEAN_PDF) \\ + \$(DX_CLEAN_LATEX)"]], +[[DX_SNIPPET_doc=""]]) +AC_SUBST([DX_RULES], +["${DX_SNIPPET_doc}"])dnl +AM_SUBST_NOTMAKE([DX_RULES]) + +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV +]) diff --git a/config/endswith.m4 b/config/endswith.m4 new file mode 100644 index 000000000..8550d098d --- /dev/null +++ b/config/endswith.m4 @@ -0,0 +1,31 @@ +AC_DEFUN([AX_CHECK_CXX_ENDS_WITH], +[ + AC_PROVIDE([AX_CHECK_CXX_ENDS_WITH]) + + AC_SUBST([HAVE_CXX_ENDS_WITH], [0]) + + AC_MSG_CHECKING([for C++ std::string::ends_with support]) + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[(std::string("This is a message")).ends_with("suffix")]])], + [AC_SUBST([HAVE_CXX_ENDS_WITH], [1])], + [AC_SUBST([HAVE_CXX_ENDS_WITH], [0])]) + + if test "$HAVE_CXX_ENDS_WITH" = "1"; then + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[(std::string("This is a message")).ends_with("suffix")]])], + [AC_SUBST([HAVE_CXX_ENDS_WITH], [1])], + [AC_SUBST([HAVE_CXX_ENDS_WITH], [0])]) + fi + + if test "$HAVE_CXX_ENDS_WITH" = "1"; then + AC_MSG_RESULT([yes]) + CXXFLAGS="-DHAVE_CXX_ENDS_WITH=1 $CXXFLAGS" + else + AC_MSG_RESULT([no]) + fi +]) diff --git a/config/filesystem.m4 b/config/filesystem.m4 new file mode 100644 index 000000000..31e848646 --- /dev/null +++ b/config/filesystem.m4 @@ -0,0 +1,31 @@ +AC_DEFUN([AX_CHECK_CXX_FILESYSTEM], +[ + AC_PROVIDE([AX_CHECK_CXX_FILESYSTEM]) + + AC_SUBST([HAVE_CXX_FILESYSTEM], [0]) + + AC_MSG_CHECKING([for C++ std::filesystem support]) + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[std::filesystem::exists("/")]])], + [AC_SUBST([HAVE_CXX_FILESYSTEM], [1])], + [AC_SUBST([HAVE_CXX_FILESYSTEM], [0])]) + + if test "$HAVE_CXX_FILESYSTEM" = "1"; then + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[std::filesystem::exists("/")]])], + [AC_SUBST([HAVE_CXX_FILESYSTEM], [1])], + [AC_SUBST([HAVE_CXX_FILESYSTEM], [0])]) + fi + + if test "$HAVE_CXX_FILESYSTEM" = "1"; then + AC_MSG_RESULT([yes]) + CXXFLAGS="-DHAVE_CXX_FILESYSTEM=1 $CXXFLAGS" + else + AC_MSG_RESULT([no]) + fi +]) diff --git a/config/install-sh b/config/install-sh new file mode 100755 index 000000000..a9244eb07 --- /dev/null +++ b/config/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config/intrinsics.m4 b/config/intrinsics.m4 new file mode 100644 index 000000000..2f99a93de --- /dev/null +++ b/config/intrinsics.m4 @@ -0,0 +1,121 @@ +# +# SSE +# + +AC_DEFUN([AX_CHECK_SSE], +[ + AC_PROVIDE([AX_CHECK_SSE]) + AC_ARG_ENABLE([sse], + [AS_HELP_STRING([--disable-sse], + [disable SSE support (default=no)])], + [enable_sse=no], + [enable_sse=yes]) + + AC_SUBST([HAVE_SSE], [0]) + + if test "$enable_sse" = "yes"; then + AC_MSG_CHECKING([for SSE support via '-msse']) + + CXXFLAGS_temp="$CXXFLAGS -msse" + + ac_run="$CXX -o conftest$ac_ext $CXXFLAGS_temp conftest.$ac_ext>&5" + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[ + __m128 x = _mm_set1_ps(1.0f); + x = _mm_add_ps(x, x); + return _mm_cvtss_f32(x) != 2.0f;]])], + [ + CXXFLAGS="$CXXFLAGS -msse" + AC_SUBST([HAVE_SSE], [1]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) + fi +]) + + + +# +# AVX +# + +AC_DEFUN([AX_CHECK_AVX], +[ + AC_PROVIDE([AX_CHECK_AVX]) + AC_ARG_ENABLE([avx], + [AS_HELP_STRING([--disable-avx], + [disable AVX support (default=no)])], + [enable_avx=no], + [enable_avx=yes]) + + AC_SUBST([HAVE_AVX], [0]) + + if test "$enable_avx" = "yes"; then + AC_MSG_CHECKING([for AVX support via '-mavx']) + + CXXFLAGS_temp="$CXXFLAGS -mavx" + ac_run_save="$ac_run" + + ac_run="$CXX -o conftest$ac_ext $CXXFLAGS_temp conftest.$ac_ext>&5" + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[ + __m256d x = _mm256_set1_pd(1.0); + x = _mm256_add_pd(x, x); + return _mm256_cvtsd_f64(x) != 2.0;]])], + [ + CXXFLAGS="$CXXFLAGS -mavx" + AC_SUBST([HAVE_AVX], [1]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) + + ac_run="$ac_run_save" + fi +]) + +# +# AVX512 +# + +AC_DEFUN([AX_CHECK_AVX512], +[ + AC_PROVIDE([AX_CHECK_AVX512]) + AC_ARG_ENABLE([avx512], + [AS_HELP_STRING([--disable-avx512], + [disable AVX512 support (default=no)])], + [enable_avx512=no], + [enable_avx512=yes]) + + AC_SUBST([HAVE_AVX512], [0]) + + if test "$enable_avx512" = "yes"; then + AC_MSG_CHECKING([for AVX-512 support via '-mavx512f']) + + CXXFLAGS_temp="$CXXFLAGS -mavx512f" + ac_run_save="$ac_run" + + ac_run="$CXX -o conftest$ac_ext $CXXFLAGS_temp conftest.$ac_ext>&5" + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[ + __m512d x = _mm512_set1_pd(1.0); + x = _mm512_add_pd(x, x); + return _mm512_cvtsd_f64(x) != 2.0;]])], + [ + CXXFLAGS="$CXXFLAGS -mavx512f" + AC_SUBST([HAVE_AVX512], [1]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) + + ac_run="$ac_run_save" + fi +]) diff --git a/config/libtool.m4 b/config/libtool.m4 new file mode 100644 index 000000000..92060119f --- /dev/null +++ b/config/libtool.m4 @@ -0,0 +1,8364 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +]) + +# serial 58 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) + case ${MACOSX_DEPLOYMENT_TARGET},$host in + 10.[[012]],*|,*powerpc*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/config/ltmain.sh b/config/ltmain.sh new file mode 100644 index 000000000..a736cf994 --- /dev/null +++ b/config/ltmain.sh @@ -0,0 +1,11156 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.6 Debian-2.4.6-2" +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname $scriptversion Debian-2.4.6-2 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/config/ltoptions.m4 b/config/ltoptions.m4 new file mode 100644 index 000000000..94b082976 --- /dev/null +++ b/config/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/config/ltsugar.m4 b/config/ltsugar.m4 new file mode 100644 index 000000000..48bc9344a --- /dev/null +++ b/config/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/config/ltversion.m4 b/config/ltversion.m4 new file mode 100644 index 000000000..fa04b52a3 --- /dev/null +++ b/config/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 4179 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.6' +macro_revision='2.4.6' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/config/lt~obsolete.m4 b/config/lt~obsolete.m4 new file mode 100644 index 000000000..c6b26f88f --- /dev/null +++ b/config/lt~obsolete.m4 @@ -0,0 +1,99 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/config/native.m4 b/config/native.m4 new file mode 100644 index 000000000..9aba13e44 --- /dev/null +++ b/config/native.m4 @@ -0,0 +1,27 @@ +AC_DEFUN([AX_CHECK_NATIVE_ARCH], +[ + AC_PROVIDE([AX_CHECK_NATIVE_ARCH]) + AC_ARG_ENABLE([native_arch], + [AS_HELP_STRING([--disable-native-arch], + [disable native architecture compilation (default=no)])], + [enable_native_arch=no], + [enable_native_arch=yes]) + + if test "$enable_native_arch" = "yes"; then + AC_MSG_CHECKING([if the compiler accepts '-march=native']) + + CXXFLAGS_temp="$CXXFLAGS -march=native" + + ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]], + [[ + int i = 5;]])], + [CXXFLAGS="$CXXFLAGS -march=native" + NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" + AC_MSG_RESULT(yes)], + [AC_SUBST([enable_native_arch], [no]) + AC_MSG_RESULT(no)]) + fi +]) diff --git a/config/openmp.m4 b/config/openmp.m4 new file mode 100644 index 000000000..866e1d664 --- /dev/null +++ b/config/openmp.m4 @@ -0,0 +1,123 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_openmp.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro tries to find out how to compile programs that use OpenMP a +# standard API and set of compiler directives for parallel programming +# (see http://www-unix.mcs/) +# +# On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS +# output variable to the flag (e.g. -omp) used both to compile *and* link +# OpenMP programs in the current language. +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. +# +# If you want to compile everything with OpenMP, you should set: +# +# CFLAGS="$CFLAGS $OPENMP_CFLAGS" +# #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" +# #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" +# +# (depending on the selected language). +# +# The user can override the default choice by setting the corresponding +# environment variable (e.g. OPENMP_CFLAGS). +# +# ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is +# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is +# not found. If ACTION-IF-FOUND is not specified, the default action will +# define HAVE_OPENMP. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2015 John W. Peterson +# Copyright (c) 2016 Nick R. Papior +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 13 + +AC_DEFUN([AX_OPENMP], [ +AC_PREREQ([2.69]) dnl for _AC_LANG_PREFIX + +AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS +ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown +# Flags to try: -fopenmp (gcc), -mp (SGI & PGI), +# -qopenmp (icc>=15), -openmp (icc), +# -xopenmp (Sun), -omp (Tru64), +# -qsmp=omp (AIX), +# none +ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then + ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" +fi +for ax_openmp_flag in $ax_openmp_flags; do + case $ax_openmp_flag in + none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; + *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; + esac + AC_LINK_IFELSE([AC_LANG_SOURCE([[ +@%:@include + +static void +parallel_fill(int * data, int n) +{ + int i; +@%:@pragma omp parallel for + for (i = 0; i < n; ++i) + data[i] = i; +} + +int +main() +{ + int arr[100000]; + omp_set_num_threads(2); + parallel_fill(arr, 100000); + return 0; +} +]])],[ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break],[]) +done +[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS +]) +if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then + m4_default([$2],:) +else + if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then + OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp + fi + m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) +fi +])dnl AX_OPENMP diff --git a/config/stdcxx.m4 b/config/stdcxx.m4 new file mode 100644 index 000000000..51a35054d --- /dev/null +++ b/config/stdcxx.m4 @@ -0,0 +1,1005 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for no added switch, and then for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper +# Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 14 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + + m4_if([$2], [], [dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi]) + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +dnl Test body for checking C++17 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L + +]]) diff --git a/config/tmpfs.m4 b/config/tmpfs.m4 new file mode 100644 index 000000000..7791a3f1c --- /dev/null +++ b/config/tmpfs.m4 @@ -0,0 +1,27 @@ +AC_DEFUN([AX_CHECK_TMPFS], +[ + AC_PROVIDE([AX_CHECK_TMPFS]) + + AC_ARG_WITH([logging_dir], + [AS_HELP_STRING([--with-logging-dir=[DIR]], + [directory for Bifrost proclog logging (default=autodetect)])], + [AC_SUBST([HAVE_TMPFS], [$with_logging_dir])], + [AC_SUBST([HAVE_TMPFS], [/tmp])]) + + if test "$HAVE_TMPFS" = "/tmp"; then + AC_CHECK_FILE([/dev/shm], + [AC_SUBST([HAVE_TMPFS], [/dev/shm/bifrost])]) + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + AC_CHECK_FILE([/Volumes/RAMDisk], + [AC_SUBST([HAVE_TMPFS], [/Volumes/RAMDisk/bifrost])]) + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + AC_CHECK_FILE([/tmp], + [AC_SUBST([HAVE_TMPFS], [/tmp])]) + AC_MSG_WARN([$HAVE_TMPFS may have performance problems for logging]) + AC_SUBST([HAVE_TMPFS], [/tmp/bifrost]) + fi +]) diff --git a/config/withprog.m4 b/config/withprog.m4 new file mode 100644 index 000000000..b3a881c0d --- /dev/null +++ b/config/withprog.m4 @@ -0,0 +1,70 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_with_prog.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH]) +# +# DESCRIPTION +# +# Locates an installed program binary, placing the result in the precious +# variable VARIABLE. Accepts a present VARIABLE, then --with-program, and +# failing that searches for program in the given path (which defaults to +# the system path). If program is found, VARIABLE is set to the full path +# of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND +# if provided, unchanged otherwise. +# +# A typical example could be the following one: +# +# AX_WITH_PROG(PERL,perl) +# +# NOTE: This macro is based upon the original AX_WITH_PYTHON macro from +# Dustin J. Mitchell . +# +# LICENSE +# +# Copyright (c) 2008 Francesco Salvestrini +# Copyright (c) 2008 Dustin J. Mitchell +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 17 + +AC_DEFUN([AX_WITH_PROG],[ + AC_PREREQ([2.61]) + + pushdef([VARIABLE],$1) + pushdef([EXECUTABLE],$2) + pushdef([VALUE_IF_NOT_FOUND],$3) + pushdef([PATH_PROG],$4) + + AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable) + + AS_IF(test -z "$VARIABLE",[ + AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided) + AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[PATH]]]],absolute path to EXECUTABLE executable), [ + AS_IF([test "$withval" != yes && test "$withval" != no],[ + VARIABLE="$withval" + AC_MSG_RESULT($VARIABLE) + ],[ + VARIABLE="" + AC_MSG_RESULT([no]) + AS_IF([test "$withval" != no], [ + AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[]) + ]) + ]) + ],[ + AC_MSG_RESULT([no]) + AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[]) + ]) + ]) + + popdef([PATH_PROG]) + popdef([VALUE_IF_NOT_FOUND]) + popdef([EXECUTABLE]) + popdef([VARIABLE]) +]) diff --git a/configure b/configure new file mode 100755 index 000000000..8582912a7 --- /dev/null +++ b/configure @@ -0,0 +1,28091 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for bifrost 0.10.0. +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='bifrost' +PACKAGE_TARNAME='bifrost' +PACKAGE_VERSION='0.10.0' +PACKAGE_STRING='bifrost 0.10.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='https://github.com/ledatelescope/bifrost/' + +ac_unique_file="src/cuda.cpp" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_subst_vars='OPTIONS +LTLIBOBJS +NVCC_GENCODE +STDCXX_IS_SET +MAP_KERNEL_STDCXX +PACKAGE_VERSION_MICRO +PACKAGE_VERSION_MINOR +PACKAGE_VERSION_MAJOR +HAVE_PYTHON_DOCS +HAVE_CXX_DOCS +PYTHON_BREATHE +PYTHON_SPHINXA +PYTHON_SPHINXB +DX_RULES +PAPER_SIZE +DOXYGEN_PAPER_SIZE +GENERATE_LATEX +DX_PDFLATEX +DX_FLAG_pdf +DX_EGREP +DX_DVIPS +DX_MAKEINDEX +DX_LATEX +DX_FLAG_ps +DX_FLAG_html +GENERATE_CHI +DX_FLAG_chi +GENERATE_HTMLHELP +GENERATE_HTML +HHC_PATH +DX_HHC +DX_FLAG_chm +GENERATE_XML +DX_FLAG_xml +GENERATE_RTF +DX_FLAG_rtf +GENERATE_MAN +DX_FLAG_man +DOT_PATH +HAVE_DOT +DX_DOT +DX_FLAG_dot +PERL_PATH +DX_PERL +DX_DOXYGEN +DX_FLAG_doc +PROJECT +SRCDIR +DX_ENV +DX_DOCDIR +DX_CONFIG +DX_PROJECT +HAVE_DOCKER +DOCKER +PYINSTALLFLAGS +PYBUILDFLAGS +PYTHON3 +PYTHON +HAVE_PYTHON +HAVE_MAP_CACHE +HAVE_CUDA_DEBUG +enable_native_arch +HAVE_AVX512 +HAVE_AVX +HAVE_SSE +HAVE_TRACE +HAVE_DEBUG +HAVE_TMPFS +ALIGNMENT +GPU_ARCHS +NVCCFLAGS +CUOBJDUMP +NVPRUNE +NVCC +GPU_EXP_PINNED_ALLOC +GPU_PASCAL_MANAGEDMEM +GPU_SHAREDMEM +GPU_MAX_ARCH +GPU_MIN_ARCH +CUDA_HAVE_CXX11 +CUDA_HAVE_CXX14 +CUDA_HAVE_CXX17 +CUDA_HAVE_CXX20 +CUDA_VERSION +HAVE_CUDA +CUDA_HOME +RDMA_MAXMEM +HAVE_RDMA +VERBS_SEND_PACING +VERBS_SEND_NPKTBUF +VERBS_NPKTBUF +HAVE_VERBS +HAVE_VMA +HAVE_HWLOC +HAVE_FLOAT128 +HAVE_OPENMP +LIBOBJS +HAVE_RECVMSG +HAVE_CXX_ENDS_WITH +HAVE_CXX_FILESYSTEM +HAVE_CXX11 +HAVE_CXX14 +HAVE_CXX17 +HAVE_CXX20 +SO_EXT +CTAGS +SET_MAKE +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +CXXCPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +AWK +RANLIB +STRIP +ac_ct_CXX +CXXFLAGS +CXX +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +AM_DEFAULT_VERBOSITY +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +with_ctags +enable_hwloc +enable_vma +enable_verbs +with_rx_buffer_size +with_tx_buffer_size +enable_rdma +with_rdma_max_mem +with_cuda_home +enable_cuda +with_nvcc_flags +with_stream_model +with_gpu_archs +with_shared_mem +with_alignment +with_logging_dir +enable_debug +enable_trace +enable_sse +enable_avx +enable_avx512 +enable_native_arch +enable_cuda_debug +enable_map_cache +enable_python +with_python +with_pybuild_flags +with_pyinstall_flags +with_docker +enable_doxygen_doc +enable_doxygen_dot +enable_doxygen_man +enable_doxygen_rtf +enable_doxygen_xml +enable_doxygen_chm +enable_doxygen_chi +enable_doxygen_html +enable_doxygen_ps +enable_doxygen_pdf +with_sphinx_build +with_sphinx_apidoc +with_breathe_apidoc +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +LT_SYS_LIBRARY_PATH +CXXCPP +CTAGS +PYTHON +DOCKER +DOXYGEN_PAPER_SIZE +PYTHON_SPHINXB +PYTHON_SPHINXA +PYTHON_BREATHE' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures bifrost 0.10.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/bifrost] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of bifrost 0.10.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-hwloc disable hwloc support (default=no) + --enable-vma enable vma support (default=no) + --disable-verbs disable Infiniband verbs support (default=no) + --disable-rdma disable RDMA support (default=no) + --disable-cuda disable cuda support (default=no) + --enable-debug enable debugging mode (default=no) + --enable-trace enable tracing mode for nvprof/nvvp (default=no) + --disable-sse disable SSE support (default=no) + --disable-avx disable AVX support (default=no) + --disable-avx512 disable AVX512 support (default=no) + --disable-native-arch disable native architecture compilation (default=no) + --enable-cuda-debug enable CUDA debugging (nvcc -G; default=no) + --disable-map-cache disable caching bifrost.map kernels (default=no) + --disable-python disable building the Python bindings (default=no) + --disable-doxygen-doc don't generate any doxygen documentation + --enable-doxygen-dot generate graphics for doxygen documentation + --enable-doxygen-man generate doxygen manual pages + --enable-doxygen-rtf generate doxygen RTF documentation + --enable-doxygen-xml generate doxygen XML documentation + --enable-doxygen-chm generate doxygen compressed HTML help documentation + --enable-doxygen-chi generate doxygen separate compressed HTML help index + file + --disable-doxygen-html don't generate doxygen plain HTML documentation + --disable-doxygen-ps don't generate doxygen PostScript documentation + --disable-doxygen-pdf don't generate doxygen PDF documentation + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-ctags=[PATH] absolute path to ctags executable + --with-rx-buffer-size=N default Infiniband verbs receive buffer size in + packets (default=8192) + --with-tx-buffer-size=N default Infiniband verbs send buffer size in packets + (default=512) + --with-rdma-max-mem=N maximum RDMA buffer size in bytes + (default=134217728) + --with-cuda-home CUDA install path (default=/usr/local/cuda) + --with-nvcc-flags flags to pass to NVCC (default='-O3 -Xcompiler + "-Wall"') + --with-stream-model CUDA default stream model to use: 'legacy' or + 'per-thread' (default='per-thread') + --with-gpu-archs=... default GPU architectures (default=detect) + --with-shared-mem=N default GPU shared memory per block in bytes + (default=detect) + --with-alignment=N default memory alignment in bytes (default=4096) + --with-logging-dir=DIR directory for Bifrost proclog logging + (default=autodetect) + --with-python=[PATH] absolute path to python executable + --with-pybuild-flags build flags for python (default='') + --with-pyinstall-flags install flags for python (default='') + --with-docker=[PATH] absolute path to docker executable + --with-sphinx-build=[PATH] + absolute path to sphinx-build executable + --with-sphinx-apidoc=[PATH] + absolute path to sphinx-apidoc executable + --with-breathe-apidoc=[PATH] + absolute path to breathe-apidoc executable + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CXXCPP C++ preprocessor + CTAGS Absolute path to ctags executable + PYTHON Absolute path to python executable + DOCKER Absolute path to docker executable + DOXYGEN_PAPER_SIZE + a4wide (default), a4, letter, legal or executive + PYTHON_SPHINXB + Absolute path to sphinx-build executable + PYTHON_SPHINXA + Absolute path to sphinx-apidoc executable + PYTHON_BREATHE + Absolute path to breathe-apidoc executable + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +bifrost home page: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +bifrost configure 0.10.0 +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_cxx_check_func LINENO FUNC VAR +# ------------------------------------ +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_cxx_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_func + +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_compile + +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_cxx_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_type + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +printf %s "checking for int$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main (void) +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main (void) +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : + +else $as_nop + break +fi + done +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +printf %s "checking for uint$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : + +else $as_nop + break +fi + done +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by bifrost $as_me 0.10.0, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub ltmain.sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/config" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + +AM_DEFAULT_VERBOSITY=1 + + +: ${CXXFLAGS="-O3 -Wall -pedantic"} + +# +# Programs +# + + + +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; +esac + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_reload_flag='-r' +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test ${with_sysroot+y} +then : + withval=$with_sysroot; +else $as_nop + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# Check whether --enable-libtool-lock was given. +if test ${enable_libtool_lock+y} +then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_cc_needs_belf=yes +else $as_nop + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_ld_exported_symbols_list=yes +else $as_nop + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) + case ${MACOSX_DEPLOYMENT_TARGET},$host in + 10.[012],*|,*powerpc*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test ${enable_shared+y} +then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test ${enable_static+y} +then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test ${with_pic+y} +then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test ${enable_fast_install+y} +then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_irix_exported_symbol=yes +else $as_nop + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes +then : + lt_cv_dlopen=shl_load +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main (void) +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_shl_load=yes +else $as_nop + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else $as_nop + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes +then : + lt_cv_dlopen=dlopen +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_svld_dlopen=yes +else $as_nop + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main (void) +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_dld_link=yes +else $as_nop + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } + + + + +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + + + + + + + + + if test -z "$CTAGS" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ctags executable path has been provided" >&5 +printf %s "checking whether ctags executable path has been provided... " >&6; } + +# Check whether --with-ctags was given. +if test ${with_ctags+y} +then : + withval=$with_ctags; + if test "$withval" != yes && test "$withval" != no +then : + + CTAGS="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } + +else $as_nop + + CTAGS="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CTAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CTAGS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CTAGS=$ac_cv_path_CTAGS +if test -n "$CTAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CTAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CTAGS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CTAGS=$ac_cv_path_CTAGS +if test -n "$CTAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + +if test x${CTAGS} = x +then : + as_fn_error $? "Required program ctags was not found" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CTAGS} is exuberant" >&5 +printf %s "checking whether ${CTAGS} is exuberant... " >&6; } +if ! ${CTAGS} --version | grep -q Exuberant +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "exuberant ctags is required, but ${CTAGS} is a different version" "$LINENO" 5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi + +SO_EXT=$shrext_cmds + + +# +# System/Compiler Features +# + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + ax_cxx_compile_alternatives="20" ax_cxx_compile_cxx20_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++20 features with $switch" >&5 +printf %s "checking whether $CXX supports C++20 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test x$ax_cxx_compile_cxx20_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++20 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX20=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++20 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++20 support was found" >&6;} + else + HAVE_CXX20=1 + +printf "%s\n" "#define HAVE_CXX20 1" >>confdefs.h + + fi + + +if test x$HAVE_CXX20 != x1 +then : + ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test x$ax_cxx_compile_cxx17_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} + else + HAVE_CXX17=1 + +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h + + fi + + + if test x$HAVE_CXX17 != x1 +then : + ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 +printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test x$ax_cxx_compile_cxx14_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX14=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} + else + HAVE_CXX14=1 + +printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h + + fi + + + if test x$HAVE_CXX14 != x1 +then : + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 + +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h + + fi + + +fi +fi +fi + + + + HAVE_CXX_FILESYSTEM=0 + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ std::filesystem support" >&5 +printf %s "checking for C++ std::filesystem support... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ +std::filesystem::exists("/") + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + HAVE_CXX_FILESYSTEM=1 + +else $as_nop + HAVE_CXX_FILESYSTEM=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "$HAVE_CXX_FILESYSTEM" = "1"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ +std::filesystem::exists("/") + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + HAVE_CXX_FILESYSTEM=1 + +else $as_nop + HAVE_CXX_FILESYSTEM=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + + if test "$HAVE_CXX_FILESYSTEM" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CXXFLAGS="-DHAVE_CXX_FILESYSTEM=1 $CXXFLAGS" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + + + + HAVE_CXX_ENDS_WITH=0 + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ std::string::ends_with support" >&5 +printf %s "checking for C++ std::string::ends_with support... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ +(std::string("This is a message")).ends_with("suffix") + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + HAVE_CXX_ENDS_WITH=1 + +else $as_nop + HAVE_CXX_ENDS_WITH=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "$HAVE_CXX_ENDS_WITH" = "1"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ +(std::string("This is a message")).ends_with("suffix") + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + HAVE_CXX_ENDS_WITH=1 + +else $as_nop + HAVE_CXX_ENDS_WITH=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + + if test "$HAVE_CXX_ENDS_WITH" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CXXFLAGS="-DHAVE_CXX_ENDS_WITH=1 $CXXFLAGS" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + +ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + +fi + +ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h + +fi + +ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes +then : + printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + +fi + + + for ac_func in recvmsg +do : + ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes +then : + printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h + HAVE_RECVMSG=1 + +else $as_nop + HAVE_RECVMSG=0 + +fi + +done +ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" +if test "x$ac_cv_func_sqrt" = xyes +then : + printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h + +fi + +ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; + + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif + +int +main (void) +{ + + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else $as_nop + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h + +fi + + + +HAVE_OPENMP=0 + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 +printf %s "checking for OpenMP flag of C++ compiler... " >&6; } +if test ${ax_cv_cxx_openmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + saveCXXFLAGS=$CXXFLAGS +ax_cv_cxx_openmp=unknown +# Flags to try: -fopenmp (gcc), -mp (SGI & PGI), +# -qopenmp (icc>=15), -openmp (icc), +# -xopenmp (Sun), -omp (Tru64), +# -qsmp=omp (AIX), +# none +ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +if test "x$OPENMP_CXXFLAGS" != x; then + ax_openmp_flags="$OPENMP_CXXFLAGS $ax_openmp_flags" +fi +for ax_openmp_flag in $ax_openmp_flags; do + case $ax_openmp_flag in + none) CXXFLAGS=$saveCXX ;; + *) CXXFLAGS="$saveCXXFLAGS $ax_openmp_flag" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +static void +parallel_fill(int * data, int n) +{ + int i; +#pragma omp parallel for + for (i = 0; i < n; ++i) + data[i] = i; +} + +int +main() +{ + int arr[100000]; + omp_set_num_threads(2); + parallel_fill(arr, 100000); + return 0; +} + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ax_cv_cxx_openmp=$ax_openmp_flag; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +done +CXXFLAGS=$saveCXXFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 +printf "%s\n" "$ax_cv_cxx_openmp" >&6; } +if test "x$ax_cv_cxx_openmp" = "xunknown"; then + : +else + if test "x$ax_cv_cxx_openmp" != "xnone"; then + OPENMP_CXXFLAGS=$ax_cv_cxx_openmp + fi + +printf "%s\n" "#define HAVE_OPENMP 1" >>confdefs.h + +fi + +if test x$OPENMP_CXXFLAGS != x +then : + HAVE_OPENMP=1 + +fi +if test x$HAVE_OPENMP != x1 +then : + +else $as_nop + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" +fi + +ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h + + +fi + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h +;; +esac + + + ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + +fi + + +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define ssize_t int" >>confdefs.h + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h + + +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + + +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h + + +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h +;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +printf %s "checking for long double with more range or precision than double... " >&6; } +if test ${ac_cv_type_long_double_wider+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } + +int +main (void) +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_type_long_double_wider=yes +else $as_nop + ac_cv_type_long_double_wider=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then + +printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + + fi + +HAVE_FLOAT128=0 + +if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 +then : + HAVE_FLOAT128=0 + +fi + +# +# HWLOC +# + +# Check whether --enable-hwloc was given. +if test ${enable_hwloc+y} +then : + enableval=$enable_hwloc; enable_hwloc=no +else $as_nop + enable_hwloc=yes +fi + +HAVE_HWLOC=0 + +if test x$enable_hwloc != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 +printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } +if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lhwloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int hwloc_topology_init (); +} +int +main (void) +{ +return conftest::hwloc_topology_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_hwloc_hwloc_topology_init=yes +else $as_nop + ac_cv_lib_hwloc_hwloc_topology_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 +printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } +if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes +then : + HAVE_HWLOC=1 + + LIBS="$LIBS -lhwloc" +fi + +fi + +# +# VMA +# + +# Check whether --enable-vma was given. +if test ${enable_vma+y} +then : + enableval=$enable_vma; enable_vma=yes +else $as_nop + enable_vma=no +fi + +HAVE_VMA=0 + +if test x$enable_vma != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 +printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } +if test ${ac_cv_lib_vma_recvfrom_zcopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lvma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int recvfrom_zcopy (); +} +int +main (void) +{ +return conftest::recvfrom_zcopy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_vma_recvfrom_zcopy=yes +else $as_nop + ac_cv_lib_vma_recvfrom_zcopy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 +printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } +if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes +then : + HAVE_VMA=1 + + LIBS="$LIBS -lvma" +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vma_recvfrom_zcopy in -lvma" >&5 +printf %s "checking for vma_recvfrom_zcopy in -lvma... " >&6; } +if test ${ac_cv_lib_vma_vma_recvfrom_zcopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lvma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int vma_recvfrom_zcopy (); +} +int +main (void) +{ +return conftest::vma_recvfrom_zcopy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_vma_vma_recvfrom_zcopy=yes +else $as_nop + ac_cv_lib_vma_vma_recvfrom_zcopy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_vma_recvfrom_zcopy" >&5 +printf "%s\n" "$ac_cv_lib_vma_vma_recvfrom_zcopy" >&6; } +if test "x$ac_cv_lib_vma_vma_recvfrom_zcopy" = xyes +then : + HAVE_VMA=1 + + LIBS="$LIBS -lvma" +fi + +fi + +# +# Infiniband Verbs +# + +# Check whether --enable-verbs was given. +if test ${enable_verbs+y} +then : + enableval=$enable_verbs; enable_verbs=no +else $as_nop + enable_verbs=yes +fi + +HAVE_VERBS=0 + +if test x$enable_verbs != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ibv_query_device in -libverbs" >&5 +printf %s "checking for ibv_query_device in -libverbs... " >&6; } +if test ${ac_cv_lib_ibverbs_ibv_query_device+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-libverbs $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int ibv_query_device (); +} +int +main (void) +{ +return conftest::ibv_query_device (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_ibverbs_ibv_query_device=yes +else $as_nop + ac_cv_lib_ibverbs_ibv_query_device=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ibverbs_ibv_query_device" >&5 +printf "%s\n" "$ac_cv_lib_ibverbs_ibv_query_device" >&6; } +if test "x$ac_cv_lib_ibverbs_ibv_query_device" = xyes +then : + HAVE_VERBS=1 + + LIBS="$LIBS -libverbs" +fi + +fi + + +# Check whether --with-rx-buffer-size was given. +if test ${with_rx_buffer_size+y} +then : + withval=$with_rx_buffer_size; +else $as_nop + with_rx_buffer_size=8192 +fi + + VERBS_NPKTBUF=$with_rx_buffer_size + + if test x$HAVE_VERBS = x0 +then : + VERBS_NPKTBUF=0 + +fi + + +# Check whether --with-tx-buffer-size was given. +if test ${with_tx_buffer_size+y} +then : + withval=$with_tx_buffer_size; +else $as_nop + with_tx_buffer_size=512 +fi + + VERBS_SEND_NPKTBUF=$with_tx_buffer_size + + if test x$HAVE_VERBS = x0 +then : + VERBS_SEND_NPKTBUF=0 + +fi + + if test x$HAVE_VERBS != x0 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Infiniband verbs packet pacing support" >&5 +printf %s "checking for Infiniband verbs packet pacing support... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ + + int ndev, d; + ibv_device** ibv_dev_list = NULL; + ibv_context* ibv_ctx = NULL; + ibv_device_attr_ex ibv_dev_attr; + + ibv_dev_list = ibv_get_device_list(&ndev); + for(d=0; d&5 +printf "%s\n" "yes" >&6; } +else $as_nop + VERBS_SEND_PACING=0 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + +# +# RDMA +# + +# Check whether --enable-rdma was given. +if test ${enable_rdma+y} +then : + enableval=$enable_rdma; enable_rdma=no +else $as_nop + enable_rdma=yes +fi + +HAVE_RDMA=0 + +if test x$enable_rdma != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rdma_get_devices in -lrdmacm" >&5 +printf %s "checking for rdma_get_devices in -lrdmacm... " >&6; } +if test ${ac_cv_lib_rdmacm_rdma_get_devices+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrdmacm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int rdma_get_devices (); +} +int +main (void) +{ +return conftest::rdma_get_devices (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_rdmacm_rdma_get_devices=yes +else $as_nop + ac_cv_lib_rdmacm_rdma_get_devices=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rdmacm_rdma_get_devices" >&5 +printf "%s\n" "$ac_cv_lib_rdmacm_rdma_get_devices" >&6; } +if test "x$ac_cv_lib_rdmacm_rdma_get_devices" = xyes +then : + HAVE_RDMA=1 + + LIBS="$LIBS -lrdmacm" +fi + +fi + + +# Check whether --with-rdma_max_mem was given. +if test ${with_rdma_max_mem+y} +then : + withval=$with_rdma_max_mem; +else $as_nop + with_rdma_max_mem=134217728 +fi + +RDMA_MAXMEM=$with_rdma_max_mem + +if test x$HAVE_RDMA = x0 +then : + RDMA_MAXMEM=0 + +fi + +# +# CUDA +# + +################################# +# NOTE # +# This needs to come after all # +# other compiler/library tests # +# since it changes LIB to # +# include CUDA-specific entries # +################################# + + + + +# Check whether --with-cuda_home was given. +if test ${with_cuda_home+y} +then : + withval=$with_cuda_home; +else $as_nop + with_cuda_home=/usr/local/cuda +fi + + CUDA_HOME=$with_cuda_home + + + # Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; enable_cuda=no +else $as_nop + enable_cuda=yes +fi + + + NVCCLIBS="" + ac_compile_save="$ac_compile" + ac_link_save="$ac_link" + ac_run_save="$ac_run" + + HAVE_CUDA=0 + + CUDA_VERSION=0 + + CUDA_HAVE_CXX20=0 + + CUDA_HAVE_CXX17=0 + + CUDA_HAVE_CXX14=0 + + CUDA_HAVE_CXX11=0 + + GPU_MIN_ARCH=0 + + GPU_MAX_ARCH=0 + + GPU_SHAREDMEM=0 + + GPU_PASCAL_MANAGEDMEM=0 + + GPU_EXP_PINNED_ALLOC=1 + + if test "$enable_cuda" != "no"; then + HAVE_CUDA=1 + + + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVCC in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" + ;; +esac +fi +NVCC=$ac_cv_path_NVCC +if test -n "$NVCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +printf "%s\n" "$NVCC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "nvprune", so it can be a program name with args. +set dummy nvprune; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVPRUNE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVPRUNE in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" + ;; +esac +fi +NVPRUNE=$ac_cv_path_NVPRUNE +if test -n "$NVPRUNE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 +printf "%s\n" "$NVPRUNE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "cuobjdump", so it can be a program name with args. +set dummy cuobjdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CUOBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CUOBJDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" + ;; +esac +fi +CUOBJDUMP=$ac_cv_path_CUOBJDUMP +if test -n "$CUOBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 +printf "%s\n" "$CUOBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA 10+ installation" >&5 +printf %s "checking for a working CUDA 10+ installation... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="$LIBS -lcuda -lcudart" + ac_ext="cu" + + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + +else $as_nop + HAVE_CUDA=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + if test "$HAVE_CUDA" = "1"; then + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="$NVCCLIBS -lcuda -lcudart" + + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS $NVCCLIBS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 +printf "%s\n" "yes - v$CUDA_VERSION" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 + + fi + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CUDA CXX standard support" >&5 +printf %s "checking for CUDA CXX standard support... " >&6; } + + CUDA_STDCXX=$( ${NVCC} --help | ${GREP} -Po -e "--std.*}" | ${SED} 's/.*|//;s/}//;' ) + if test "$CUDA_STDCXX" = "c++20"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: C++20" >&5 +printf "%s\n" "C++20" >&6; } + CUDA_HAVE_CXX20=1 + + else + if test "$CUDA_STDCXX" = "c++17"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: C++17" >&5 +printf "%s\n" "C++17" >&6; } + CUDA_HAVE_CXX17=1 + + else + if test "$CUDA_STDCXX" = "c++14"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: C++14" >&5 +printf "%s\n" "C++14" >&6; } + CUDA_HAVE_CXX14=1 + + else + if test "$CUDA_STDCXX" = "c++11"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: C++11" >&5 +printf "%s\n" "C++11" >&6; } + CUDA_HAVE_CXX11=1 + + else + as_fn_error $? "nvcc does not support at least C++11" "$LINENO" 5 + fi + fi + fi + fi + fi + + +# Check whether --with-nvcc_flags was given. +if test ${with_nvcc_flags+y} +then : + withval=$with_nvcc_flags; +else $as_nop + with_nvcc_flags='-O3 -Xcompiler "-Wall"' +fi + + NVCCFLAGS=$with_nvcc_flags + + + +# Check whether --with-stream_model was given. +if test ${with_stream_model+y} +then : + withval=$with_stream_model; +else $as_nop + with_stream_model='per-thread' +fi + + + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for different CUDA default stream models" >&5 +printf %s "checking for different CUDA default stream models... " >&6; } + dsm_supported=$( ${NVCC} -h | ${GREP} -Po -e "--default-stream" ) + if test "$dsm_supported" = "--default-stream"; then + if test "$with_stream_model" = "per-thread"; then + NVCCFLAGS="$NVCCFLAGS -default-stream per-thread" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, using 'per-thread'" >&5 +printf "%s\n" "yes, using 'per-thread'" >&6; } + else + if test "$with_stream_model" = "legacy"; then + NVCCFLAGS="$NVCCFLAGS -default-stream legacy" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, using 'legacy'" >&5 +printf "%s\n" "yes, using 'legacy'" >&6; } + else + as_fn_error $? "Invalid CUDA stream model: '$with_stream_model'" "$LINENO" 5 + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, only the 'legacy' stream model is supported" >&5 +printf "%s\n" "no, only the 'legacy' stream model is supported" >&6; } + fi + fi + + if test "$HAVE_CUDA" = "1"; then + CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" + CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" + NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" + LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="$NVCCLIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" + fi + + +# Check whether --with-gpu_archs was given. +if test ${with_gpu_archs+y} +then : + withval=$with_gpu_archs; +else $as_nop + with_gpu_archs='auto' +fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 +printf %s "checking for valid CUDA architectures... " >&6; } + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_supported_flat=$( echo $ar_supported | xargs ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 +printf "%s\n" "found: $ar_supported_flat" >&6; } + + if test "$with_gpu_archs" = "auto"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 +printf %s "checking which CUDA architectures to target... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="-lcuda -lcudart" + ax_ext="cu" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS $NVCCLIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include + #include + #include + #include +int +main (void) +{ + + std::set archs; + int major, minor, arch; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + std::ofstream fh; + fh.open("confarchs.out"); + for(int dev=0; dev 0 ) { + fh << " "; + } + fh << arch; + } + arch += minor; + if( archs.count(arch) == 0 ) { + archs.insert(arch); + fh << " " << arch; + } + } + fh.close(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + GPU_ARCHS=`cat confarchs.out` + + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + if test "$ar_valid" = ""; then + as_fn_error $? "failed to find any supported" "$LINENO" 5 + else + GPU_ARCHS=$ar_valid + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 +printf "%s\n" "$GPU_ARCHS" >&6; } + fi +else $as_nop + as_fn_error $? "failed to find any" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + else + GPU_ARCHS=$with_gpu_archs + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 +printf %s "checking for valid requested CUDA architectures... " >&6; } + ar_requested=$( echo "$GPU_ARCHS" | wc -w ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + ar_found=$( echo $ar_valid | wc -w ) + if test "$ar_requested" = "$ar_found"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 + fi + + ar_min_valid=$(echo $ar_valid | ${SED} -e 's/ .*//g;' ) + GPU_MIN_ARCH=$ar_min_valid + + ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) + GPU_MAX_ARCH=$ar_max_valid + + + +# Check whether --with-shared_mem was given. +if test ${with_shared_mem+y} +then : + withval=$with_shared_mem; +else $as_nop + with_shared_mem='auto' +fi + + if test "$with_shared_mem" = "auto"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for minimum shared memory per block" >&5 +printf %s "checking for minimum shared memory per block... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="-lcuda -lcudart" + ac_ext="cu" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include + #include + #include + #include +int +main (void) +{ + + std::set smem; + int smemSize; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + for(int dev=0; dev&5 +printf "%s\n" "$GPU_SHAREDMEM B" >&6; } +else $as_nop + as_fn_error $? "failed to determine a value" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + else + GPU_SHAREDMEM=$with_shared_mem + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 +printf %s "checking for Pascal-style CUDA managed memory... " >&6; } + cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) + if ! echo $cm_invalid | ${GREP} -q PRE; then + GPU_PASCAL_MANAGEDMEM=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + GPU_PASCAL_MANAGEDMEM=0 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thrust pinned allocated support" >&5 +printf %s "checking for thrust pinned allocated support... " >&6; } + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + NVCCLIBS_save="$NVCCLIBS" + ac_ext_save="$ac_ext" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + NVCCLIBS="-lcuda -lcudart" + ac_ext="cu" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS $NVCCLIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include + #include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + GPU_EXP_PINNED_ALLOC=0 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: full" >&5 +printf "%s\n" "full" >&6; } +else $as_nop + GPU_EXP_PINNED_ALLOC=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: experimental" >&5 +printf "%s\n" "experimental" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + NVCCLIBS="$NVCCLIBS_save" + ac_ext="$ac_ext_save" + else + GPU_PASCAL_MANAGEDMEM=0 + + GPU_EXP_PINNED_ALLOC=1 + + fi + + ac_compile="$ac_compile_save" + ac_link="$ac_link_save" + ac_run="$ac_run_save" + + +# +# Bifrost memory alignment +# + + +# Check whether --with-alignment was given. +if test ${with_alignment+y} +then : + withval=$with_alignment; +else $as_nop + with_alignment=4096 +fi + +ALIGNMENT=$with_alignment + + +# +# Bifrost proclog location +# + + + + + +# Check whether --with-logging_dir was given. +if test ${with_logging_dir+y} +then : + withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir + +else $as_nop + HAVE_TMPFS=/tmp + +fi + + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 +printf %s "checking for /dev/shm... " >&6; } +if test ${ac_cv_file__dev_shm+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/dev/shm"; then + ac_cv_file__dev_shm=yes +else + ac_cv_file__dev_shm=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 +printf "%s\n" "$ac_cv_file__dev_shm" >&6; } +if test "x$ac_cv_file__dev_shm" = xyes +then : + HAVE_TMPFS=/dev/shm/bifrost + +fi + + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 +printf %s "checking for /Volumes/RAMDisk... " >&6; } +if test ${ac_cv_file__Volumes_RAMDisk+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/Volumes/RAMDisk"; then + ac_cv_file__Volumes_RAMDisk=yes +else + ac_cv_file__Volumes_RAMDisk=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 +printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } +if test "x$ac_cv_file__Volumes_RAMDisk" = xyes +then : + HAVE_TMPFS=/Volumes/RAMDisk/bifrost + +fi + + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 +printf %s "checking for /tmp... " >&6; } +if test ${ac_cv_file__tmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/tmp"; then + ac_cv_file__tmp=yes +else + ac_cv_file__tmp=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 +printf "%s\n" "$ac_cv_file__tmp" >&6; } +if test "x$ac_cv_file__tmp" = xyes +then : + HAVE_TMPFS=/tmp + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 +printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} + HAVE_TMPFS=/tmp/bifrost + + fi + + +# +# Bifrost Features +# + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; enable_debug=yes +else $as_nop + enable_debug=no +fi + +HAVE_DEBUG=0 + +if test x$enable_debug != xno +then : + HAVE_DEBUG=1 + + CXXFLAGS="$CXXFLAGS -g" + NVCCFLAGS="$NVCCFLAGS -g" +fi + +# Check whether --enable-trace was given. +if test ${enable_trace+y} +then : + enableval=$enable_trace; enable_trace=yes +else $as_nop + enable_trace=no +fi + +HAVE_TRACE=0 + +if test x$enable_trace != xno +then : + HAVE_TRACE=1 + +fi + + + + # Check whether --enable-sse was given. +if test ${enable_sse+y} +then : + enableval=$enable_sse; enable_sse=no +else $as_nop + enable_sse=yes +fi + + + HAVE_SSE=0 + + + if test "$enable_sse" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE support via '-msse'" >&5 +printf %s "checking for SSE support via '-msse'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -msse" + + ac_run="$CXX -o conftest$ac_ext $CXXFLAGS_temp conftest.$ac_ext>&5" + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ + + __m128 x = _mm_set1_ps(1.0f); + x = _mm_add_ps(x, x); + return _mm_cvtss_f32(x) != 2.0f; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + + CXXFLAGS="$CXXFLAGS -msse" + HAVE_SSE=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + # Check whether --enable-avx was given. +if test ${enable_avx+y} +then : + enableval=$enable_avx; enable_avx=no +else $as_nop + enable_avx=yes +fi + + + HAVE_AVX=0 + + + if test "$enable_avx" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX support via '-mavx'" >&5 +printf %s "checking for AVX support via '-mavx'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -mavx" + ac_run_save="$ac_run" + + ac_run="$CXX -o conftest$ac_ext $CXXFLAGS_temp conftest.$ac_ext>&5" + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ + + __m256d x = _mm256_set1_pd(1.0); + x = _mm256_add_pd(x, x); + return _mm256_cvtsd_f64(x) != 2.0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + + CXXFLAGS="$CXXFLAGS -mavx" + HAVE_AVX=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + ac_run="$ac_run_save" + fi + + + + # Check whether --enable-avx512 was given. +if test ${enable_avx512+y} +then : + enableval=$enable_avx512; enable_avx512=no +else $as_nop + enable_avx512=yes +fi + + + HAVE_AVX512=0 + + + if test "$enable_avx512" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX-512 support via '-mavx512f'" >&5 +printf %s "checking for AVX-512 support via '-mavx512f'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -mavx512f" + ac_run_save="$ac_run" + + ac_run="$CXX -o conftest$ac_ext $CXXFLAGS_temp conftest.$ac_ext>&5" + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include +int +main (void) +{ + + __m512d x = _mm512_set1_pd(1.0); + x = _mm512_add_pd(x, x); + return _mm512_cvtsd_f64(x) != 2.0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + + CXXFLAGS="$CXXFLAGS -mavx512f" + HAVE_AVX512=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + ac_run="$ac_run_save" + fi + + + + # Check whether --enable-native_arch was given. +if test ${enable_native_arch+y} +then : + enableval=$enable_native_arch; enable_native_arch=no +else $as_nop + enable_native_arch=yes +fi + + + if test "$enable_native_arch" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 +printf %s "checking if the compiler accepts '-march=native'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -march=native" + + ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + +int +main (void) +{ + + int i = 5; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + CXXFLAGS="$CXXFLAGS -march=native" + NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + enable_native_arch=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + +# Check whether --enable-cuda_debug was given. +if test ${enable_cuda_debug+y} +then : + enableval=$enable_cuda_debug; enable_cuda_debug=yes +else $as_nop + enable_cuda_debug=no +fi + +HAVE_CUDA_DEBUG=0 + +if test x$enable_cuda_debug != xno +then : + HAVE_CUDA_DEBUG=1 + + NVCCFLAGS="$NVCCFLAGS -G" +fi + +# Check whether --enable-map_cache was given. +if test ${enable_map_cache+y} +then : + enableval=$enable_map_cache; enable_map_cache=no +else $as_nop + enable_map_cache=yes +fi + +HAVE_MAP_CACHE=0 + +if test x$enable_map_cache != xno +then : + HAVE_MAP_CACHE=$HAVE_CUDA + +fi + +# +# Python +# + +# Check whether --enable-python was given. +if test ${enable_python+y} +then : + enableval=$enable_python; enable_python=no +else $as_nop + enable_python=yes +fi + +HAVE_PYTHON=0 + +if test x$enable_python != xno +then : + + + + + + + + + + + if test -z "$PYTHON" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether python executable path has been provided" >&5 +printf %s "checking whether python executable path has been provided... " >&6; } + +# Check whether --with-python was given. +if test ${with_python+y} +then : + withval=$with_python; + if test "$withval" != yes && test "$withval" != no +then : + + PYTHON="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } + +else $as_nop + + PYTHON="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + + if test x${PYTHON} = xno +then : + # Extract the first word of "python3", so it can be a program name with args. +set dummy python3; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON3 in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON3="$PYTHON3" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON3="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON3" && ac_cv_path_PYTHON3="no" + ;; +esac +fi +PYTHON3=$ac_cv_path_PYTHON3 +if test -n "$PYTHON3"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5 +printf "%s\n" "$PYTHON3" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test x${PYTHON3} != xno +then : + PYTHON=$PYTHON3 + +fi +fi + if test x${PYTHON} != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $PYTHON is version 3.6 or later" >&5 +printf %s "checking if $PYTHON is version 3.6 or later... " >&6; } + if ! ${PYTHON} -c "import sys; assert(sys.version_info >= (3,6,0))" 2>/dev/null +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 +printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} + PYTHON=no + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +fi + if test x${PYTHON} != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 +printf %s "checking whether $PYTHON as ctypesgen... " >&6; } + if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 +printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_PYTHON=1 + +fi +fi +fi + +# Check whether --with-pybuild_flags was given. +if test ${with_pybuild_flags+y} +then : + withval=$with_pybuild_flags; +fi + +PYBUILDFLAGS=$with_pybuild_flags + + + +# Check whether --with-pyinstall_flags was given. +if test ${with_pyinstall_flags+y} +then : + withval=$with_pyinstall_flags; +fi + +PYINSTALLFLAGS=$with_pyinstall_flags + + +# +# Docker +# + + + + + + + + + + + + if test -z "$DOCKER" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether docker executable path has been provided" >&5 +printf %s "checking whether docker executable path has been provided... " >&6; } + +# Check whether --with-docker was given. +if test ${with_docker+y} +then : + withval=$with_docker; + if test "$withval" != yes && test "$withval" != no +then : + + DOCKER="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } + +else $as_nop + + DOCKER="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "docker", so it can be a program name with args. +set dummy docker; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOCKER+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOCKER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" + ;; +esac +fi +DOCKER=$ac_cv_path_DOCKER +if test -n "$DOCKER"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "docker", so it can be a program name with args. +set dummy docker; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOCKER+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOCKER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" + ;; +esac +fi +DOCKER=$ac_cv_path_DOCKER +if test -n "$DOCKER"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + +if test x${DOCKER} != xno +then : + HAVE_DOCKER=1 + +fi + +# +# Documentation +# + + + +# Files: +DX_PROJECT=bifrost + +DX_CONFIG='$(srcdir)/Doxyfile' + +DX_DOCDIR='doxygen-doc' + + +# Environment variables used inside doxygen.cfg: +DX_ENV="$DX_ENV SRCDIR='$srcdir'" +SRCDIR=$srcdir + +DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" +PROJECT=$DX_PROJECT + +DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" + + +# Doxygen itself: + + + + # Check whether --enable-doxygen-doc was given. +if test ${enable_doxygen_doc+y} +then : + enableval=$enable_doxygen_doc; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_doc=1 + + +;; #( +n|N|no|No|NO) + DX_FLAG_doc=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_doc=1 + + + +fi + +if test "$DX_FLAG_doc" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. +set dummy ${ac_tool_prefix}doxygen; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN +if test -n "$DX_DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 +printf "%s\n" "$DX_DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DOXYGEN"; then + ac_pt_DX_DOXYGEN=$DX_DOXYGEN + # Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN +if test -n "$ac_pt_DX_DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 +printf "%s\n" "$ac_pt_DX_DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DOXYGEN" = x; then + DX_DOXYGEN="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DOXYGEN=$ac_pt_DX_DOXYGEN + fi +else + DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" +fi + +if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. +set dummy ${ac_tool_prefix}perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_PERL=$ac_cv_path_DX_PERL +if test -n "$DX_PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 +printf "%s\n" "$DX_PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_PERL"; then + ac_pt_DX_PERL=$DX_PERL + # Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL +if test -n "$ac_pt_DX_PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 +printf "%s\n" "$ac_pt_DX_PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_PERL" = x; then + DX_PERL="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_PERL=$ac_pt_DX_PERL + fi +else + DX_PERL="$ac_cv_path_DX_PERL" +fi + +if test "$DX_FLAG_doc$DX_PERL" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + : +fi +if test "$DX_FLAG_doc" = 1; then + DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" +PERL_PATH=$DX_PERL + + : +else + + : +fi + + +# Dot for graphics: + + + + # Check whether --enable-doxygen-dot was given. +if test ${enable_doxygen_dot+y} +then : + enableval=$enable_doxygen_dot; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_dot=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-dot requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_dot=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_dot=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 + + + +fi + +if test "$DX_FLAG_dot" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. +set dummy ${ac_tool_prefix}dot; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DOT=$ac_cv_path_DX_DOT +if test -n "$DX_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 +printf "%s\n" "$DX_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DOT"; then + ac_pt_DX_DOT=$DX_DOT + # Extract the first word of "dot", so it can be a program name with args. +set dummy dot; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT +if test -n "$ac_pt_DX_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 +printf "%s\n" "$ac_pt_DX_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DOT" = x; then + DX_DOT="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DOT=$ac_pt_DX_DOT + fi +else + DX_DOT="$ac_cv_path_DX_DOT" +fi + +if test "$DX_FLAG_dot$DX_DOT" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} + DX_FLAG_dot=0 + +fi + + : +fi +if test "$DX_FLAG_dot" = 1; then + DX_ENV="$DX_ENV HAVE_DOT='YES'" +HAVE_DOT=YES + + DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" +DOT_PATH=`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'` + + : +else + DX_ENV="$DX_ENV HAVE_DOT='NO'" +HAVE_DOT=NO + + : +fi + + +# Man pages generation: + + + + # Check whether --enable-doxygen-man was given. +if test ${enable_doxygen_man+y} +then : + enableval=$enable_doxygen_man; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_man=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-man requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_man=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_man=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 + + + +fi + +if test "$DX_FLAG_man" = 1; then + + : +fi +if test "$DX_FLAG_man" = 1; then + DX_ENV="$DX_ENV GENERATE_MAN='YES'" +GENERATE_MAN=YES + + : +else + DX_ENV="$DX_ENV GENERATE_MAN='NO'" +GENERATE_MAN=NO + + : +fi + + +# RTF file generation: + + + + # Check whether --enable-doxygen-rtf was given. +if test ${enable_doxygen_rtf+y} +then : + enableval=$enable_doxygen_rtf; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_rtf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-rtf requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_rtf=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_rtf=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 + + + +fi + +if test "$DX_FLAG_rtf" = 1; then + + : +fi +if test "$DX_FLAG_rtf" = 1; then + DX_ENV="$DX_ENV GENERATE_RTF='YES'" +GENERATE_RTF=YES + + : +else + DX_ENV="$DX_ENV GENERATE_RTF='NO'" +GENERATE_RTF=NO + + : +fi + + +# XML file generation: + + + + # Check whether --enable-doxygen-xml was given. +if test ${enable_doxygen_xml+y} +then : + enableval=$enable_doxygen_xml; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_xml=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-xml requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_xml=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_xml=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 + + + +fi + +if test "$DX_FLAG_xml" = 1; then + + : +fi +if test "$DX_FLAG_xml" = 1; then + DX_ENV="$DX_ENV GENERATE_XML='YES'" +GENERATE_XML=YES + + : +else + DX_ENV="$DX_ENV GENERATE_XML='NO'" +GENERATE_XML=NO + + : +fi + + +# (Compressed) HTML help generation: + + + + # Check whether --enable-doxygen-chm was given. +if test ${enable_doxygen_chm+y} +then : + enableval=$enable_doxygen_chm; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chm=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-chm requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_chm=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_chm=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 + + + +fi + +if test "$DX_FLAG_chm" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. +set dummy ${ac_tool_prefix}hhc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_HHC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_HHC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_HHC=$ac_cv_path_DX_HHC +if test -n "$DX_HHC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 +printf "%s\n" "$DX_HHC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_HHC"; then + ac_pt_DX_HHC=$DX_HHC + # Extract the first word of "hhc", so it can be a program name with args. +set dummy hhc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_HHC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_HHC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC +if test -n "$ac_pt_DX_HHC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 +printf "%s\n" "$ac_pt_DX_HHC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_HHC" = x; then + DX_HHC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_HHC=$ac_pt_DX_HHC + fi +else + DX_HHC="$ac_cv_path_DX_HHC" +fi + +if test "$DX_FLAG_chm$DX_HHC" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 +printf "%s\n" "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} + DX_FLAG_chm=0 + +fi + + : +fi +if test "$DX_FLAG_chm" = 1; then + DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" +HHC_PATH=$DX_HHC + + DX_ENV="$DX_ENV GENERATE_HTML='YES'" +GENERATE_HTML=YES + + DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" +GENERATE_HTMLHELP=YES + + : +else + DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" +GENERATE_HTMLHELP=NO + + : +fi + + +# Separate CHI file generation. + + + + # Check whether --enable-doxygen-chi was given. +if test ${enable_doxygen_chi+y} +then : + enableval=$enable_doxygen_chi; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chi=1 + + +test "$DX_FLAG_chm" = "1" \ +|| as_fn_error $? "doxygen-chi requires doxygen-chm" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_chi=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_chi=0 + + +test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 + + + +fi + +if test "$DX_FLAG_chi" = 1; then + + : +fi +if test "$DX_FLAG_chi" = 1; then + DX_ENV="$DX_ENV GENERATE_CHI='YES'" +GENERATE_CHI=YES + + : +else + DX_ENV="$DX_ENV GENERATE_CHI='NO'" +GENERATE_CHI=NO + + : +fi + + +# Plain HTML pages generation: + + + + # Check whether --enable-doxygen-html was given. +if test ${enable_doxygen_html+y} +then : + enableval=$enable_doxygen_html; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-html requires doxygen-doc" "$LINENO" 5 + +test "$DX_FLAG_chm" = "0" \ +|| as_fn_error $? "doxygen-html contradicts doxygen-chm" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_html=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 + + +test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 + + + +fi + +if test "$DX_FLAG_html" = 1; then + + : +fi +if test "$DX_FLAG_html" = 1; then + DX_ENV="$DX_ENV GENERATE_HTML='YES'" +GENERATE_HTML=YES + + : +else + test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" +GENERATE_HTML=NO + + : +fi + + +# PostScript file generation: + + + + # Check whether --enable-doxygen-ps was given. +if test ${enable_doxygen_ps+y} +then : + enableval=$enable_doxygen_ps; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-ps requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_ps=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 + + + +fi + +if test "$DX_FLAG_ps" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. +set dummy ${ac_tool_prefix}latex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_LATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_LATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_LATEX=$ac_cv_path_DX_LATEX +if test -n "$DX_LATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 +printf "%s\n" "$DX_LATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_LATEX"; then + ac_pt_DX_LATEX=$DX_LATEX + # Extract the first word of "latex", so it can be a program name with args. +set dummy latex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_LATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_LATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX +if test -n "$ac_pt_DX_LATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 +printf "%s\n" "$ac_pt_DX_LATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_LATEX" = x; then + DX_LATEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_LATEX=$ac_pt_DX_LATEX + fi +else + DX_LATEX="$ac_cv_path_DX_LATEX" +fi + +if test "$DX_FLAG_ps$DX_LATEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX +if test -n "$DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 +printf "%s\n" "$DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX +if test -n "$ac_pt_DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 +printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_MAKEINDEX" = x; then + DX_MAKEINDEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX + fi +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. +set dummy ${ac_tool_prefix}dvips; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DVIPS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DVIPS=$ac_cv_path_DX_DVIPS +if test -n "$DX_DVIPS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 +printf "%s\n" "$DX_DVIPS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DVIPS"; then + ac_pt_DX_DVIPS=$DX_DVIPS + # Extract the first word of "dvips", so it can be a program name with args. +set dummy dvips; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DVIPS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS +if test -n "$ac_pt_DX_DVIPS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 +printf "%s\n" "$ac_pt_DX_DVIPS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DVIPS" = x; then + DX_DVIPS="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DVIPS=$ac_pt_DX_DVIPS + fi +else + DX_DVIPS="$ac_cv_path_DX_DVIPS" +fi + +if test "$DX_FLAG_ps$DX_DVIPS" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP +if test -n "$DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 +printf "%s\n" "$DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP +if test -n "$ac_pt_DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 +printf "%s\n" "$ac_pt_DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_EGREP" = x; then + DX_EGREP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_EGREP=$ac_pt_DX_EGREP + fi +else + DX_EGREP="$ac_cv_path_DX_EGREP" +fi + +if test "$DX_FLAG_ps$DX_EGREP" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + : +fi +if test "$DX_FLAG_ps" = 1; then + + : +else + + : +fi + + +# PDF file generation: + + + + # Check whether --enable-doxygen-pdf was given. +if test ${enable_doxygen_pdf+y} +then : + enableval=$enable_doxygen_pdf; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-pdf requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_pdf=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 + + + +fi + +if test "$DX_FLAG_pdf" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. +set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_PDFLATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX +if test -n "$DX_PDFLATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 +printf "%s\n" "$DX_PDFLATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_PDFLATEX"; then + ac_pt_DX_PDFLATEX=$DX_PDFLATEX + # Extract the first word of "pdflatex", so it can be a program name with args. +set dummy pdflatex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_PDFLATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX +if test -n "$ac_pt_DX_PDFLATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 +printf "%s\n" "$ac_pt_DX_PDFLATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_PDFLATEX" = x; then + DX_PDFLATEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_PDFLATEX=$ac_pt_DX_PDFLATEX + fi +else + DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" +fi + +if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX +if test -n "$DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 +printf "%s\n" "$DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX +if test -n "$ac_pt_DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 +printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_MAKEINDEX" = x; then + DX_MAKEINDEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX + fi +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP +if test -n "$DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 +printf "%s\n" "$DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP +if test -n "$ac_pt_DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 +printf "%s\n" "$ac_pt_DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_EGREP" = x; then + DX_EGREP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_EGREP=$ac_pt_DX_EGREP + fi +else + DX_EGREP="$ac_cv_path_DX_EGREP" +fi + +if test "$DX_FLAG_pdf$DX_EGREP" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + : +fi +if test "$DX_FLAG_pdf" = 1; then + + : +else + + : +fi + + +# LaTeX generation for PS and/or PDF: +if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then + DX_ENV="$DX_ENV GENERATE_LATEX='YES'" +GENERATE_LATEX=YES + +else + DX_ENV="$DX_ENV GENERATE_LATEX='NO'" +GENERATE_LATEX=NO + +fi + +# Paper size for PS and/or PDF: + +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + DOXYGEN_PAPER_SIZE="" + +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" +PAPER_SIZE=$DOXYGEN_PAPER_SIZE + +;; #( +*) + as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 +;; +esac + +# Rules: +if test $DX_FLAG_html -eq 1 +then : + DX_SNIPPET_html="## ------------------------------- ## +## Rules specific for HTML output. ## +## ------------------------------- ## + +DX_CLEAN_HTML = \$(DX_DOCDIR)/html\\ + \$(DX_DOCDIR)/html + +" +else $as_nop + DX_SNIPPET_html="" +fi +if test $DX_FLAG_chi -eq 1 +then : + DX_SNIPPET_chi=" +DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi\\ + \$(DX_DOCDIR)/\$(PACKAGE).chi" +else $as_nop + DX_SNIPPET_chi="" +fi +if test $DX_FLAG_chm -eq 1 +then : + DX_SNIPPET_chm="## ------------------------------ ## +## Rules specific for CHM output. ## +## ------------------------------ ## + +DX_CLEAN_CHM = \$(DX_DOCDIR)/chm\\ + \$(DX_DOCDIR)/chm\ +${DX_SNIPPET_chi} + +" +else $as_nop + DX_SNIPPET_chm="" +fi +if test $DX_FLAG_man -eq 1 +then : + DX_SNIPPET_man="## ------------------------------ ## +## Rules specific for MAN output. ## +## ------------------------------ ## + +DX_CLEAN_MAN = \$(DX_DOCDIR)/man\\ + \$(DX_DOCDIR)/man + +" +else $as_nop + DX_SNIPPET_man="" +fi +if test $DX_FLAG_rtf -eq 1 +then : + DX_SNIPPET_rtf="## ------------------------------ ## +## Rules specific for RTF output. ## +## ------------------------------ ## + +DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf\\ + \$(DX_DOCDIR)/rtf + +" +else $as_nop + DX_SNIPPET_rtf="" +fi +if test $DX_FLAG_xml -eq 1 +then : + DX_SNIPPET_xml="## ------------------------------ ## +## Rules specific for XML output. ## +## ------------------------------ ## + +DX_CLEAN_XML = \$(DX_DOCDIR)/xml\\ + \$(DX_DOCDIR)/xml + +" +else $as_nop + DX_SNIPPET_xml="" +fi +if test $DX_FLAG_ps -eq 1 +then : + DX_SNIPPET_ps="## ----------------------------- ## +## Rules specific for PS output. ## +## ----------------------------- ## + +DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps\\ + \$(DX_DOCDIR)/\$(PACKAGE).ps + +DX_PS_GOAL = doxygen-ps + +doxygen-ps: \$(DX_CLEAN_PS) + +\$(DX_DOCDIR)/\$(PACKAGE).ps: \$(DX_DOCDIR)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_LATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_LATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_LATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi + +" +else $as_nop + DX_SNIPPET_ps="" +fi +if test $DX_FLAG_pdf -eq 1 +then : + DX_SNIPPET_pdf="## ------------------------------ ## +## Rules specific for PDF output. ## +## ------------------------------ ## + +DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf\\ + \$(DX_DOCDIR)/\$(PACKAGE).pdf + +DX_PDF_GOAL = doxygen-pdf + +doxygen-pdf: \$(DX_CLEAN_PDF) + +\$(DX_DOCDIR)/\$(PACKAGE).pdf: \$(DX_DOCDIR)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_PDFLATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + mv refman.pdf ../\$(PACKAGE).pdf + +" +else $as_nop + DX_SNIPPET_pdf="" +fi +if test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1 +then : + DX_SNIPPET_latex="## ------------------------------------------------- ## +## Rules specific for LaTeX (shared for PS and PDF). ## +## ------------------------------------------------- ## + +DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) +_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_LATEX_0 = @echo \" LATEX \" \$@; + +DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex\\ + \$(DX_DOCDIR)/latex + +" +else $as_nop + DX_SNIPPET_latex="" +fi + +if test $DX_FLAG_doc -eq 1 +then : + DX_SNIPPET_doc="## --------------------------------- ## +## Format-independent Doxygen rules. ## +## --------------------------------- ## + +${DX_SNIPPET_html}\ +${DX_SNIPPET_chm}\ +${DX_SNIPPET_man}\ +${DX_SNIPPET_rtf}\ +${DX_SNIPPET_xml}\ +${DX_SNIPPET_ps}\ +${DX_SNIPPET_pdf}\ +${DX_SNIPPET_latex}\ +DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) +_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; + +.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +doxygen-run: \$(DX_DOCDIR)/\$(PACKAGE).tag + +doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +\$(DX_DOCDIR)/\$(PACKAGE).tag: \$(DX_CONFIG) \$(pkginclude_HEADERS) + \$(A""M_V_at)rm -rf \$(DX_DOCDIR) + \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR) \$(DX_DOXYGEN) \$(DX_CONFIG) + \$(A""M_V_at)echo Timestamp >\$@ + +DX_CLEANFILES = \\ + \$(DX_DOCDIR)/doxygen_sqlite3.db \\ + \$(DX_DOCDIR)/\$(PACKAGE).tag \\ + -r \\ + \$(DX_CLEAN_HTML) \\ + \$(DX_CLEAN_CHM) \\ + \$(DX_CLEAN_CHI) \\ + \$(DX_CLEAN_MAN) \\ + \$(DX_CLEAN_RTF) \\ + \$(DX_CLEAN_XML) \\ + \$(DX_CLEAN_PS) \\ + \$(DX_CLEAN_PDF) \\ + \$(DX_CLEAN_LATEX)" +else $as_nop + DX_SNIPPET_doc="" +fi +DX_RULES="${DX_SNIPPET_doc}" + + +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV + + + + + + + + + + + +if test x${HAVE_PYTHON} == x1 +then : + + + + + + + + + + + if test -z "$PYTHON_SPHINXB" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sphinx-build executable path has been provided" >&5 +printf %s "checking whether sphinx-build executable path has been provided... " >&6; } + +# Check whether --with-sphinx-build was given. +if test ${with_sphinx_build+y} +then : + withval=$with_sphinx_build; + if test "$withval" != yes && test "$withval" != no +then : + + PYTHON_SPHINXB="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPHINXB" >&5 +printf "%s\n" "$PYTHON_SPHINXB" >&6; } + +else $as_nop + + PYTHON_SPHINXB="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "sphinx-build", so it can be a program name with args. +set dummy sphinx-build; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON_SPHINXB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON_SPHINXB in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON_SPHINXB="$PYTHON_SPHINXB" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON_SPHINXB="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON_SPHINXB=$ac_cv_path_PYTHON_SPHINXB +if test -n "$PYTHON_SPHINXB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPHINXB" >&5 +printf "%s\n" "$PYTHON_SPHINXB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "sphinx-build", so it can be a program name with args. +set dummy sphinx-build; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON_SPHINXB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON_SPHINXB in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON_SPHINXB="$PYTHON_SPHINXB" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON_SPHINXB="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON_SPHINXB=$ac_cv_path_PYTHON_SPHINXB +if test -n "$PYTHON_SPHINXB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPHINXB" >&5 +printf "%s\n" "$PYTHON_SPHINXB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + + + + + + + + + + + + if test -z "$PYTHON_SPHINXA" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sphinx-apidoc executable path has been provided" >&5 +printf %s "checking whether sphinx-apidoc executable path has been provided... " >&6; } + +# Check whether --with-sphinx-apidoc was given. +if test ${with_sphinx_apidoc+y} +then : + withval=$with_sphinx_apidoc; + if test "$withval" != yes && test "$withval" != no +then : + + PYTHON_SPHINXA="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPHINXA" >&5 +printf "%s\n" "$PYTHON_SPHINXA" >&6; } + +else $as_nop + + PYTHON_SPHINXA="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "sphinx-apidoc", so it can be a program name with args. +set dummy sphinx-apidoc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON_SPHINXA+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON_SPHINXA in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON_SPHINXA="$PYTHON_SPHINXA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON_SPHINXA="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON_SPHINXA=$ac_cv_path_PYTHON_SPHINXA +if test -n "$PYTHON_SPHINXA"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPHINXA" >&5 +printf "%s\n" "$PYTHON_SPHINXA" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "sphinx-apidoc", so it can be a program name with args. +set dummy sphinx-apidoc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON_SPHINXA+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON_SPHINXA in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON_SPHINXA="$PYTHON_SPHINXA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON_SPHINXA="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON_SPHINXA=$ac_cv_path_PYTHON_SPHINXA +if test -n "$PYTHON_SPHINXA"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPHINXA" >&5 +printf "%s\n" "$PYTHON_SPHINXA" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + + + + + + + + + + + + if test -z "$PYTHON_BREATHE" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether breathe-apidoc executable path has been provided" >&5 +printf %s "checking whether breathe-apidoc executable path has been provided... " >&6; } + +# Check whether --with-breathe-apidoc was given. +if test ${with_breathe_apidoc+y} +then : + withval=$with_breathe_apidoc; + if test "$withval" != yes && test "$withval" != no +then : + + PYTHON_BREATHE="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BREATHE" >&5 +printf "%s\n" "$PYTHON_BREATHE" >&6; } + +else $as_nop + + PYTHON_BREATHE="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "breathe-apidoc", so it can be a program name with args. +set dummy breathe-apidoc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON_BREATHE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON_BREATHE in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON_BREATHE="$PYTHON_BREATHE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON_BREATHE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON_BREATHE=$ac_cv_path_PYTHON_BREATHE +if test -n "$PYTHON_BREATHE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BREATHE" >&5 +printf "%s\n" "$PYTHON_BREATHE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "breathe-apidoc", so it can be a program name with args. +set dummy breathe-apidoc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON_BREATHE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON_BREATHE in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON_BREATHE="$PYTHON_BREATHE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON_BREATHE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON_BREATHE=$ac_cv_path_PYTHON_BREATHE +if test -n "$PYTHON_BREATHE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BREATHE" >&5 +printf "%s\n" "$PYTHON_BREATHE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + +fi + +HAVE_CXX_DOCS=0 + +HAVE_PYTHON_DOCS=0 + +if test x${DX_DOXYGEN} == x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: missing doxygen, documentation cannot be built" >&5 +printf "%s\n" "$as_me: WARNING: missing doxygen, documentation cannot be built" >&2;} +else $as_nop + HAVE_CXX_DOCS=1 + + if test x${PYTHON} != xno +then : + if test x${PYTHON_SPHINXB} = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: missing the sphinx-build, python documentation cannot not be built" >&5 +printf "%s\n" "$as_me: WARNING: missing the sphinx-build, python documentation cannot not be built" >&2;} +else $as_nop + if test x${PYTHON_SPHINXA} = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: missing the sphinx-apidoc, python documentation cannot not be built" >&5 +printf "%s\n" "$as_me: WARNING: missing the sphinx-apidoc, python documentation cannot not be built" >&2;} +else $as_nop + if test x${PYTHON_BREATHE} = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: missing the breathe-apidoc, python documentation cannot not be built" >&5 +printf "%s\n" "$as_me: WARNING: missing the breathe-apidoc, python documentation cannot not be built" >&2;} +else $as_nop + HAVE_PYTHON_DOCS=1 + +fi +fi +fi +fi +fi + + +# Version splitting +# + +PACKAGE_VERSION_MAJOR=`echo $PACKAGE_VERSION | $AWK -F. '{print $1}'` + +PACKAGE_VERSION_MINOR=`echo $PACKAGE_VERSION | $AWK -F. '{print $2}'` + +PACKAGE_VERSION_MICRO=`echo $PACKAGE_VERSION | $AWK -F. '{print $3}'` + + +# +# C++20/C++17/C++14/C++11 toggling +# + +MAP_KERNEL_STDCXX=c++11 + +STDCXX_IS_SET=0 + +if test x$HAVE_CXX20 = x1 +then : + STDCXX_IS_SET=1 + + CXXFLAGS="-std=c++20 $CXXFLAGS" + if test x$CUDA_HAVE_CXX20 = x1 +then : + NVCCFLAGS="-std=c++20 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++20 + +else $as_nop + if test x$CUDA_HAVE_CXX17 = x1 +then : + NVCCFLAGS="-std=c++17 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++17 + +else $as_nop + if test x$CUDA_HAVE_CXX14 = x1 +then : + NVCCFLAGS="-std=c++14 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++14 + +else $as_nop + NVCCFLAGS="-std=c++11 $NVCCFLAGS" +fi +fi +fi +fi +if test x$HAVE_CXX17 = x1 +then : + STDCXX_IS_SET=1 + + CXXFLAGS="-std=c++17 $CXXFLAGS" + if test x$CUDA_HAVE_CXX20 = x1 +then : + NVCCFLAGS="-std=c++17 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++17 + +else $as_nop + if test x$CUDA_HAVE_CXX17 = x1 +then : + NVCCFLAGS="-std=c++17 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++17 + +else $as_nop + if test x$CUDA_HAVE_CXX14 = x1 +then : + NVCCFLAGS="-std=c++14 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++14 + +else $as_nop + NVCCFLAGS="-std=c++11 $NVCCFLAGS" +fi +fi +fi +fi +if test x$HAVE_CXX14 = x1 +then : + STDCXX_IS_SET=1 + + CXXFLAGS="-std=c++14 $CXXFLAGS" + if test x$CUDA_HAVE_CXX20 = x1 +then : + NVCCFLAGS="-std=c++14 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++14 + +else $as_nop + if test x$CUDA_HAVE_CXX17 = x1 +then : + NVCCFLAGS="-std=c++14 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++14 + +else $as_nop + if test x$CUDA_HAVE_CXX14 = x1 +then : + NVCCFLAGS="-std=c++14 $NVCCFLAGS" + MAP_KERNEL_STDCXX=c++14 + +else $as_nop + NVCCFLAGS="-std=c++11 $NVCCFLAGS" +fi +fi +fi +fi +if test x$STDCXX_IS_SET != x1 +then : + STDCXX_IS_SET=1 + + CXXFLAGS="-std=c++11 $CXXFLAGS" + NVCCFLAGS="-std=c++11 -Xcompiler \"-DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT\" $NVCCFLAGS" +fi + +# +# Linking flags +# + +CXXFLAGS="$CXXFLAGS $lt_prog_compiler_pic_CXX" +NVCCFLAGS="$NVCCFLAGS -Xcompiler \"$lt_prog_compiler_pic_CXX\"" +LIBS="$LIBS $NVCCLIBS" + +# +# Additional CUDA flags +# + +if test x$HAVE_CUDA != x0 +then : + NVCC_GENCODE=$(echo $GPU_ARCHS | ${SED} -e 's/\([0-9]\{2,3\}\)/-gencode arch=compute_\1,\\"code=sm_\1\\"/g;') + NVCC_GENCODE="$NVCC_GENCODE -gencode arch=compute_${GPU_MAX_ARCH},\\\"code=compute_${GPU_MAX_ARCH}\\\"" + NVCCFLAGS="$NVCCFLAGS ${NVCC_GENCODE}" + CPPFLAGS="$CPPFLAGS -I$CUDA_HOME/include" + +fi + +ac_config_files="$ac_config_files config.mk Makefile src/Makefile python/Makefile docs/Makefile share/bifrost.pc src/bifrost/config.h" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by bifrost $as_me 0.10.0, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider. +bifrost home page: ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +bifrost config.status 0.10.0 +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "share/bifrost.pc") CONFIG_FILES="$CONFIG_FILES share/bifrost.pc" ;; + "src/bifrost/config.h") CONFIG_FILES="$CONFIG_FILES src/bifrost/config.h" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +# +# User warnings +# + +# +# User notes +# + +echo "" + +if test x$HAVE_CUDA = x1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: cuda: yes - v$CUDA_VERSION - $GPU_ARCHS - $with_stream_model streams" >&5 +printf "%s\n" "$as_me: cuda: yes - v$CUDA_VERSION - $GPU_ARCHS - $with_stream_model streams" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: cuda: no" >&5 +printf "%s\n" "$as_me: cuda: no" >&6;} +fi + +if test x$HAVE_HWLOC = x1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: hwloc: yes" >&5 +printf "%s\n" "$as_me: hwloc: yes" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: hwloc: no" >&5 +printf "%s\n" "$as_me: hwloc: no" >&6;} +fi + +if test x$HAVE_VMA = x1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libvma: yes" >&5 +printf "%s\n" "$as_me: libvma: yes" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libvma: no" >&5 +printf "%s\n" "$as_me: libvma: no" >&6;} +fi + +if test x$HAVE_VERBS = x1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libverbs: yes" >&5 +printf "%s\n" "$as_me: libverbs: yes" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libverbs: no" >&5 +printf "%s\n" "$as_me: libverbs: no" >&6;} +fi + +if test x$HAVE_RDMA = x1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: librdmacm: yes" >&5 +printf "%s\n" "$as_me: librdmacm: yes" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: librdmacm: no" >&5 +printf "%s\n" "$as_me: librdmacm: no" >&6;} +fi + +if test x$HAVE_PYTHON = x1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: python bindings: yes" >&5 +printf "%s\n" "$as_me: python bindings: yes" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: python bindings: no" >&5 +printf "%s\n" "$as_me: python bindings: no" >&6;} +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: memory alignment: $ALIGNMENT" >&5 +printf "%s\n" "$as_me: memory alignment: $ALIGNMENT" >&6;} + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: logging directory: $HAVE_TMPFS" >&5 +printf "%s\n" "$as_me: logging directory: $HAVE_TMPFS" >&6;} + + +if test x$enable_debug != xno +then : + OPTIONS="$OPTIONS debug" + +fi +if test x$enable_trace != xno +then : + OPTIONS="$OPTIONS trace" + +fi +if test x$enable_cuda_debug != xno +then : + OPTIONS="$OPTIONS cuda_debug" + +fi +if test x$HAVE_SSE != x0 +then : + OPTIONS="$OPTIONS sse" + +fi +if test x$HAVE_AVX != x0 +then : + OPTIONS="$OPTIONS avx" + +fi +if test x$HAVE_AVX512 != x0 +then : + OPTIONS="$OPTIONS avx512" + +fi +if test x$enable_native_arch != xno +then : + OPTIONS="$OPTIONS native" + +fi +if test x$HAVE_FLOAT128 != x0 +then : + OPTIONS="$OPTIONS float128" + +fi +if test x$enable_map_cache != xno +then : + OPTIONS="$OPTIONS map_cache" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: options:$OPTIONS" >&5 +printf "%s\n" "$as_me: options:$OPTIONS" >&6;} + +echo "" +echo "Bifrost is now ready to be compiled. Please run 'make'" +echo "" + diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..618faebbd --- /dev/null +++ b/configure.ac @@ -0,0 +1,515 @@ +AC_INIT([bifrost], [0.10.0], [], [], [https://github.com/ledatelescope/bifrost/]) +AC_LANG(C++) +AC_CONFIG_SRCDIR([src/cuda.cpp]) + +AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_MACRO_DIR([config]) + +m4_ifdef([AM_SILENT_RULES], [], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) + +: ${CXXFLAGS="-O3 -Wall -pedantic"} + +# +# Programs +# + +LT_INIT +AC_PROG_CC +AC_PROG_CXX +AC_PROG_AWK +AC_PROG_SED +AC_PROG_INSTALL +AC_PROG_LIBTOOL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AX_WITH_PROG(CTAGS, ctags) +AS_IF([test x${CTAGS} = x], + [AC_MSG_ERROR([Required program ctags was not found])], + []) +AC_MSG_CHECKING([whether ${CTAGS} is exuberant]) +AS_IF([! ${CTAGS} --version | grep -q Exuberant], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([exuberant ctags is required, but ${CTAGS} is a different version])], + [AC_MSG_RESULT([yes])]) + +AC_SUBST(SO_EXT, $shrext_cmds) + +# +# System/Compiler Features +# + +AC_C_INLINE +AX_CXX_COMPILE_STDCXX(20, noext, optional) +AS_IF([test x$HAVE_CXX20 != x1], + [AX_CXX_COMPILE_STDCXX(17, noext, optional) + AS_IF([test x$HAVE_CXX17 != x1], + [AX_CXX_COMPILE_STDCXX(14, noext, optional) + AS_IF([test x$HAVE_CXX14 != x1], + [AX_CXX_COMPILE_STDCXX(11, noext, mandatory)])])]) +AX_CHECK_CXX_FILESYSTEM +AX_CHECK_CXX_ENDS_WITH +AC_CHECK_FUNCS([memset]) +AC_CHECK_FUNCS([rint]) +AC_CHECK_FUNCS([socket]) +AC_CHECK_FUNCS([recvmsg], + [AC_SUBST([HAVE_RECVMSG], [1])], + [AC_SUBST([HAVE_RECVMSG], [0])]) +AC_CHECK_FUNCS([sqrt]) +AC_CHECK_FUNCS([strerror]) +AC_CHECK_HEADERS([arpa/inet.h]) +AC_CHECK_HEADERS([netdb.h]) +AC_CHECK_HEADERS([netinet/in.h]) +AC_CHECK_HEADERS([sys/file.h]) +AC_CHECK_HEADERS([sys/ioctl.h]) +AC_CHECK_HEADERS([sys/socket.h]) +AC_CHECK_HEADER_STDBOOL +AC_FUNC_MALLOC + +AC_SUBST(HAVE_OPENMP, 0) +AX_OPENMP +AS_IF([test x$OPENMP_CXXFLAGS != x], + [AC_SUBST(HAVE_OPENMP, 1)]) +AS_IF([test x$HAVE_OPENMP != x1], + [], + [CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS"]) + +AC_CHECK_TYPES([ptrdiff_t]) +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INT8_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T +AC_TYPE_LONG_DOUBLE_WIDER +AC_SUBST([HAVE_FLOAT128], [0]) +AS_IF([test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1], + [AC_SUBST([HAVE_FLOAT128], [0])]) + +# +# HWLOC +# + +AC_ARG_ENABLE([hwloc], + AS_HELP_STRING([--disable-hwloc], + [disable hwloc support (default=no)]), + [enable_hwloc=no], + [enable_hwloc=yes]) +AC_SUBST([HAVE_HWLOC], [0]) +AS_IF([test x$enable_hwloc != xno], + [AC_CHECK_LIB([hwloc], [hwloc_topology_init], + [AC_SUBST([HAVE_HWLOC], [1]) + LIBS="$LIBS -lhwloc"])]) + +# +# VMA +# + +AC_ARG_ENABLE([vma], + AS_HELP_STRING([--enable-vma], + [enable vma support (default=no)]), + [enable_vma=yes], + [enable_vma=no]) +AC_SUBST([HAVE_VMA], [0]) +AS_IF([test x$enable_vma != xno], + [AC_CHECK_LIB([vma], [recvfrom_zcopy], + [AC_SUBST([HAVE_VMA], [1]) + LIBS="$LIBS -lvma"]) + AC_CHECK_LIB([vma], [vma_recvfrom_zcopy], + [AC_SUBST([HAVE_VMA], [1]) + LIBS="$LIBS -lvma"])]) + +# +# Infiniband Verbs +# + +AC_ARG_ENABLE([verbs], + AS_HELP_STRING([--disable-verbs], + [disable Infiniband verbs support (default=no)]), + [enable_verbs=no], + [enable_verbs=yes]) +AC_SUBST([HAVE_VERBS], [0]) +AS_IF([test x$enable_verbs != xno], + [AC_CHECK_LIB([ibverbs], [ibv_query_device], + [AC_SUBST([HAVE_VERBS], [1]) + LIBS="$LIBS -libverbs"])]) + + AC_ARG_WITH([rx-buffer-size], + [AS_HELP_STRING([--with-rx-buffer-size=N], + [default Infiniband verbs receive buffer size in packets (default=8192)])], + [], + [with_rx_buffer_size=8192]) + AC_SUBST([VERBS_NPKTBUF], [$with_rx_buffer_size]) + AS_IF([test x$HAVE_VERBS = x0], + [AC_SUBST([VERBS_NPKTBUF], [0])]) + + AC_ARG_WITH([tx-buffer-size], + [AS_HELP_STRING([--with-tx-buffer-size=N], + [default Infiniband verbs send buffer size in packets (default=512)])], + [], + [with_tx_buffer_size=512]) + AC_SUBST([VERBS_SEND_NPKTBUF], [$with_tx_buffer_size]) + AS_IF([test x$HAVE_VERBS = x0], + [AC_SUBST([VERBS_SEND_NPKTBUF], [0])]) + + AS_IF([test x$HAVE_VERBS != x0], + [AC_MSG_CHECKING([for Infiniband verbs packet pacing support]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include ]], + [[ + int ndev, d; + ibv_device** ibv_dev_list = NULL; + ibv_context* ibv_ctx = NULL; + ibv_device_attr_ex ibv_dev_attr; + + ibv_dev_list = ibv_get_device_list(&ndev); + for(d=0; d= (3,6,0))" 2>/dev/null], + [AC_MSG_RESULT([no]) + AC_MSG_WARN([python module will not be built]) + AC_SUBST([PYTHON], [no])], + [AC_MSG_RESULT([yes])])]) + AS_IF([test x${PYTHON} != xno], + [AC_MSG_CHECKING([whether $PYTHON as ctypesgen]) + AS_IF([! ${PYTHON} -c "import ctypesgen" 2>/dev/null], + [AC_MSG_RESULT([no]) + AC_MSG_WARN([python module will not be built])], + [AC_MSG_RESULT([yes]) + AC_SUBST(HAVE_PYTHON, 1)])])]) +AC_ARG_WITH([pybuild_flags], + [AS_HELP_STRING([--with-pybuild-flags], + [build flags for python (default='')])], + [], + []) +AC_SUBST(PYBUILDFLAGS, $with_pybuild_flags) + +AC_ARG_WITH([pyinstall_flags], + [AS_HELP_STRING([--with-pyinstall-flags], + [install flags for python (default='')])], + [], + []) +AC_SUBST(PYINSTALLFLAGS, $with_pyinstall_flags) + +# +# Docker +# + +AX_WITH_PROG(DOCKER, docker, no, $PATH) +AS_IF([test x${DOCKER} != xno], + [AC_SUBST(HAVE_DOCKER, 1)]) + +# +# Documentation +# + +DX_INIT_DOXYGEN([bifrost]) +DX_DOT_FEATURE(OFF) +DX_HTML_FEATURE(ON) +DX_CHM_FEATURE(OFF) +DX_CHI_FEATURE(OFF) +DX_MAN_FEATURE(ON) +DX_RTF_FEATURE(OFF) +DX_XML_FEATURE(OFF) +DX_PDF_FEATURE(ON) +DX_PS_FEATURE(ON) + +AS_IF([test x${HAVE_PYTHON} == x1], + [AX_WITH_PROG(PYTHON_SPHINXB, sphinx-build) + AX_WITH_PROG(PYTHON_SPHINXA, sphinx-apidoc) + AX_WITH_PROG(PYTHON_BREATHE, breathe-apidoc)]) + +AC_SUBST(HAVE_CXX_DOCS, 0) +AC_SUBST(HAVE_PYTHON_DOCS, 0) +AS_IF([test x${DX_DOXYGEN} == x], + [AC_MSG_WARN([missing doxygen, documentation cannot be built])], + [AC_SUBST(HAVE_CXX_DOCS, 1) + AS_IF([test x${PYTHON} != xno], + [AS_IF([test x${PYTHON_SPHINXB} = x], + [AC_MSG_WARN([missing the sphinx-build, python documentation cannot not be built])], + [AS_IF([test x${PYTHON_SPHINXA} = x], + [AC_MSG_WARN([missing the sphinx-apidoc, python documentation cannot not be built])], + [AS_IF([test x${PYTHON_BREATHE} = x], + [AC_MSG_WARN([missing the breathe-apidoc, python documentation cannot not be built])], + [AC_SUBST(HAVE_PYTHON_DOCS, 1)])])])])]) + + +# Version splitting +# + +AC_SUBST([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | $AWK -F. '{print $1}'`]) +AC_SUBST([PACKAGE_VERSION_MINOR], [`echo $PACKAGE_VERSION | $AWK -F. '{print $2}'`]) +AC_SUBST([PACKAGE_VERSION_MICRO], [`echo $PACKAGE_VERSION | $AWK -F. '{print $3}'`]) + +# +# C++20/C++17/C++14/C++11 toggling +# + +AC_SUBST([MAP_KERNEL_STDCXX], [c++11]) +AC_SUBST([STDCXX_IS_SET], [0]) +AS_IF([test x$HAVE_CXX20 = x1], + [AC_SUBST([STDCXX_IS_SET], [1]) + CXXFLAGS="-std=c++20 $CXXFLAGS" + AS_IF([test x$CUDA_HAVE_CXX20 = x1], + [NVCCFLAGS="-std=c++20 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++20])], + [AS_IF([test x$CUDA_HAVE_CXX17 = x1], + [NVCCFLAGS="-std=c++17 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++17])], + [AS_IF([test x$CUDA_HAVE_CXX14 = x1], + [NVCCFLAGS="-std=c++14 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++14])], + [NVCCFLAGS="-std=c++11 $NVCCFLAGS"])])])]) +AS_IF([test x$HAVE_CXX17 = x1], + [AC_SUBST([STDCXX_IS_SET], [1]) + CXXFLAGS="-std=c++17 $CXXFLAGS" + AS_IF([test x$CUDA_HAVE_CXX20 = x1], + [NVCCFLAGS="-std=c++17 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++17])], + [AS_IF([test x$CUDA_HAVE_CXX17 = x1], + [NVCCFLAGS="-std=c++17 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++17])], + [AS_IF([test x$CUDA_HAVE_CXX14 = x1], + [NVCCFLAGS="-std=c++14 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++14])], + [NVCCFLAGS="-std=c++11 $NVCCFLAGS"])])])]) +AS_IF([test x$HAVE_CXX14 = x1], + [AC_SUBST([STDCXX_IS_SET], [1]) + CXXFLAGS="-std=c++14 $CXXFLAGS" + AS_IF([test x$CUDA_HAVE_CXX20 = x1], + [NVCCFLAGS="-std=c++14 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++14])], + [AS_IF([test x$CUDA_HAVE_CXX17 = x1], + [NVCCFLAGS="-std=c++14 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++14])], + [AS_IF([test x$CUDA_HAVE_CXX14 = x1], + [NVCCFLAGS="-std=c++14 $NVCCFLAGS" + AC_SUBST([MAP_KERNEL_STDCXX], [c++14])], + [NVCCFLAGS="-std=c++11 $NVCCFLAGS"])])])]) +AS_IF([test x$STDCXX_IS_SET != x1], + [AC_SUBST([STDCXX_IS_SET], [1]) + CXXFLAGS="-std=c++11 $CXXFLAGS" + NVCCFLAGS="-std=c++11 -Xcompiler \"-DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT\" $NVCCFLAGS"]) + +# +# Linking flags +# + +CXXFLAGS="$CXXFLAGS $lt_prog_compiler_pic_CXX" +NVCCFLAGS="$NVCCFLAGS -Xcompiler \"$lt_prog_compiler_pic_CXX\"" +LIBS="$LIBS $NVCCLIBS" + +# +# Additional CUDA flags +# +AC_SUBST([NVCC_GENCODE], []) +AS_IF([test x$HAVE_CUDA != x0], + [NVCC_GENCODE=$(echo $GPU_ARCHS | ${SED} -e 's/\([[0-9]]\{2,3\}\)/-gencode arch=compute_\1,\\"code=sm_\1\\"/g;') + NVCC_GENCODE="$NVCC_GENCODE -gencode arch=compute_${GPU_MAX_ARCH},\\\"code=compute_${GPU_MAX_ARCH}\\\"" + NVCCFLAGS="$NVCCFLAGS ${NVCC_GENCODE}" + CPPFLAGS="$CPPFLAGS -I$CUDA_HOME/include" + ]) + +AC_CONFIG_FILES([config.mk Makefile src/Makefile python/Makefile docs/Makefile share/bifrost.pc src/bifrost/config.h]) + +AC_OUTPUT + +# +# User warnings +# + +# +# User notes +# + +echo "" + +AS_IF([test x$HAVE_CUDA = x1], + [AC_MSG_NOTICE(cuda: yes - v$CUDA_VERSION - $GPU_ARCHS - $with_stream_model streams)], + [AC_MSG_NOTICE(cuda: no)]) + +AS_IF([test x$HAVE_HWLOC = x1], + [AC_MSG_NOTICE(hwloc: yes)], + [AC_MSG_NOTICE(hwloc: no)]) + +AS_IF([test x$HAVE_VMA = x1], + [AC_MSG_NOTICE(libvma: yes)], + [AC_MSG_NOTICE(libvma: no)]) + +AS_IF([test x$HAVE_VERBS = x1], + [AC_MSG_NOTICE(libverbs: yes)], + [AC_MSG_NOTICE(libverbs: no)]) + +AS_IF([test x$HAVE_RDMA = x1], + [AC_MSG_NOTICE(librdmacm: yes)], + [AC_MSG_NOTICE(librdmacm: no)]) + +AS_IF([test x$HAVE_PYTHON = x1], + [AC_MSG_NOTICE(python bindings: yes)], + [AC_MSG_NOTICE(python bindings: no)]) + +AC_MSG_NOTICE(memory alignment: $ALIGNMENT) + +AC_MSG_NOTICE(logging directory: $HAVE_TMPFS) + +AC_SUBST([OPTIONS], []) +AS_IF([test x$enable_debug != xno], + [AC_SUBST([OPTIONS], ["$OPTIONS debug"])]) +AS_IF([test x$enable_trace != xno], + [AC_SUBST([OPTIONS], ["$OPTIONS trace"])]) +AS_IF([test x$enable_cuda_debug != xno], + [AC_SUBST([OPTIONS], ["$OPTIONS cuda_debug"])]) +AS_IF([test x$HAVE_SSE != x0], + [AC_SUBST([OPTIONS], ["$OPTIONS sse"])]) +AS_IF([test x$HAVE_AVX != x0], + [AC_SUBST([OPTIONS], ["$OPTIONS avx"])]) +AS_IF([test x$HAVE_AVX512 != x0], + [AC_SUBST([OPTIONS], ["$OPTIONS avx512"])]) +AS_IF([test x$enable_native_arch != xno], + [AC_SUBST([OPTIONS], ["$OPTIONS native"])]) +AS_IF([test x$HAVE_FLOAT128 != x0], + [AC_SUBST([OPTIONS], ["$OPTIONS float128"])]) +AS_IF([test x$enable_map_cache != xno], + [AC_SUBST([OPTIONS], ["$OPTIONS map_cache"])]) +AC_MSG_NOTICE(options:$OPTIONS) + +echo "" +echo "Bifrost is now ready to be compiled. Please run 'make'" +echo "" diff --git a/docs/Makefile b/docs/Makefile.in similarity index 66% rename from docs/Makefile rename to docs/Makefile.in index f7d093d3f..8d4d63995 100644 --- a/docs/Makefile +++ b/docs/Makefile.in @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build +SPHINXBUILD = @PYTHON_SPHINXB@ SPHINXPROJ = bifrost SOURCEDIR = source BUILDDIR = build @@ -20,15 +20,15 @@ help: @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) generate_python_reference: - sphinx-apidoc -o source -d 5 --force ../python/bifrost/ + @PYTHON_SPHINXA@ -o source -d 5 --force ../python/bifrost/ rm source/modules.rst - sed -i '1s/.*/Python Reference/' source/bifrost.rst - sed -i '2s/.*/================/' source/bifrost.rst - sed -i '1s/.*/Block Library Reference/' source/bifrost.blocks.rst - sed -i '2s/.*/=======================/' source/bifrost.blocks.rst + @SED@ -i '1s/.*/Python Reference/' source/bifrost.rst + @SED@ -i '2s/.*/================/' source/bifrost.rst + @SED@ -i '1s/.*/Block Library Reference/' source/bifrost.blocks.rst + @SED@ -i '2s/.*/=======================/' source/bifrost.blocks.rst .PHONY: generate_python_reference generate_cpp_reference: - breathe-apidoc -o source -p bifrost --force ./doxygen/xml/ + @PYTHON_BREATHE@ -o source -p bifrost --force ./doxygen/xml/ rm -rf source/file .PHONY: generate_cpp_reference diff --git a/docs/README.rst b/docs/README.rst index f757e304f..f56d4f41c 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -10,3 +10,9 @@ Inside the `docs` folder, execute `./docker_build_docs.sh`, which will create a container called `bifrost_docs`, then run it, and have it complete the docs-building process for you, outputting the entire html documentation inside `docs/html`. + +If you are not using Docker, ensure that you have "sphinx", "breathe", +and "doxygen" installed. In the parent directory run "doxygen Doxyfile." +Return to the docs directory, where you can run, for example, +"make singlehtml" where "singlehtml" can be replaced +by the format you wish the docs to be in. diff --git a/docs/source/Common-installation-and-execution-problems.rst b/docs/source/Common-installation-and-execution-problems.rst index f33d16e82..1a998714c 100644 --- a/docs/source/Common-installation-and-execution-problems.rst +++ b/docs/source/Common-installation-and-execution-problems.rst @@ -12,14 +12,6 @@ timeout, and some blocks are not ending themselves. Quit the program (by ctrl-\\), and make sure every block in your pipeline is reading/writing to its rings as it should. -OSError: ..../lib/libbifrost.so: undefined symbol: cudaFreeHost ---------------------------------------------------------------- - -At the make step, nvcc did not link cudaFreeHost into libbifrost.so. You -should make sure that config.mk and user.mk are set up for your system, -and that your nvcc compiler can compile other CUDA programs. If you are -still having trouble, raise an issue. - OSError: Can't find library with name libbifrost.so --------------------------------------------------- @@ -30,15 +22,14 @@ do not have the libbifrost.so file there. To fix this, type ``echo $LD_LIBRARY_PATH`` at your command line. If none of these folders contain the Bifrost -installation (which you specified in config.mk), you have found the -problem. Perform +installation (which you may have specified with configure), you have found +the problem. Perform ``export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my/bifrost/installation``, where ``/my/bifrost/installation`` is the folder where you installed the -Bifrost "lib" (in config.mk, this folder is given as -``INSTALL_LIB_DIR``). This should add Bifrost to the wrapper's search -path. +Bifrost "lib" (this location will also be reported as part of `make install`). +This should add Bifrost to the wrapper's search path. OSError: libcudart.so.x.0: cannot open shared object file: No such file or directory ------------------------------------------------------------------------------------ diff --git a/docs/source/Cpp-Development.rst b/docs/source/Cpp-Development.rst index 21f6a59bd..061c87ed5 100644 --- a/docs/source/Cpp-Development.rst +++ b/docs/source/Cpp-Development.rst @@ -81,3 +81,78 @@ Create a Ring Buffer and Load Data bfRingSpanRelease(my_read_span); bfRingSequenceClose(my_read_sequence); bfRingDestroy(my_ring); //delete the ring from memory + +Adding New Packet Formats +------------------------ + +A wide variety of packet formats are already included in Bifrost. +For simplicity, it is likely preferable to make use of these pre-existing +formats. In the case that this becomes infeasible, here are some of what +is necessary in order to add a new format to Bifrost. + +Files to edit: + +1. ``python/bifrost/packet_capture.py`` + + * Add ``set_mypacket`` to the ``PacketCaptureCallback`` class. It will likely look + very similar to the ``set_chips`` method. + +2. ``src/bifrost/packet_capture.h`` + + * This is for ctypesgen. Add a typedef for the sequence callback. This typedef + corresponds to the sequence callback used in the packet reader, see the sections + on ``test_udp_io.py`` and ``test_disk_io.py`` for examples of writing the packet reader. + * Also declare the capture callback. + +3. ``src/formats/format.hpp`` + + * Add a one-line ``#include "mypacket.hpp"`` + +4. `src/formats/mypacket.hpp` + + * This is the only file that will need to be fully written from scratch. The + easiest way to proceed is to copy the most similar existing packet format and + modify it accordingly. One will need to make sure that the header is defined + properly and that the correct information is going into it, and one will need + to make sure that the `memcpy` operation is properly filling the packet with + data. + +5. ``src/packet_capture.cpp`` + + * Need to add a call to the packet capture callback. + +6. ``src/packet_capture.hpp`` + + * This is where you will spend most of your time. Add your packet capture sequence + callback to the ``BFpacketcapture_callback_impl`` initialization list. Immediately + after the initialization list, add the ``set_mypacket`` and ``get_mypacket`` methods. + * Add a new class: ``BFpacketcapture_mypacket_impl``. In the case of simpler packet + formats, this may be very close to the already written ``BFpacketcapture_chips_impl``. + It's probably best to start by copying the format that is closest to the format + you are writing and modify it. + * In ``BFpacketcapture_create``, add the format to the first long if-else if statement. + This section tells the disk writer the size of the packet to expect. Then add your + packet to the second if-else if statement. + +7. ``src/packet_writer.hpp`` + + * After the ``BFpacketwriter_generic_impl``, add a class ``BFpacketwriter_mypacket_impl``. + Take care to choose the correct BF\_DTYPE\_???. + * In ``BFpacketwriter_create``, add your packet to the first if-else if statement. + Note that nsamples needs to correspond to the number elements in the data portion + of the packet. Then add your packet to the third if-else if statement along all + the other formats. + +8. ``test/test_disk_io.py`` + + * Add a reader for your packet format. This reader will be what is used in the actual + code as well. It contains the sequence callback that we declared in the ``src/bifrost/packet_capture.h`` + file. Note that the header in this sequence callback is the ring header not the + packet header. + * You will also need to add a ``_get_mypacket_data``, ``test_write_mypacket``, + and ``test_read_mypacket``. + +9. ``test/test_udp_io.py`` + + * The UDP version of ``test_disk_io``. Once you have written the disk I/O test, this + test is fairly simple to implement, provided you wrote it correctly. diff --git a/docs/source/Create-a-pipeline.rst b/docs/source/Create-a-pipeline.rst index 7f83a1461..5e0e6f7c1 100644 --- a/docs/source/Create-a-pipeline.rst +++ b/docs/source/Create-a-pipeline.rst @@ -13,13 +13,9 @@ handles all the behind-the-scenes pipeline construction, giving you a high-level view at arranging a series of blocks. -We would like to construct the following pipeline, -which will serve to calculate the beats per minute -of a song. As we will soon see, some intermediate -operations will be required to get the bpm, and -we can then write our own block. +We would like to construct a pipeline to perform the following: -1. Read in a ``.wav`` file to a ring buffer. +1. Read in a ``.wav`` audio file to a ring buffer. #. Channelize it with a GPU FFT. #. Write it back to disk as a filterbank file. @@ -39,7 +35,7 @@ This setup will require bifrost blocks which: #. Write this data to a filterbank file. This file could then be used to do things like calculating -the beats per minute of the song at different points of time, or +the beats per minute (bpm) of the song at different points of time, or could be used to just view the frequency components of the song with time. First, ensure you have a working Bifrost installation. You should @@ -60,12 +56,23 @@ library as ``bf``: Next, let's load in some function libraries. We want ``blocks``, which is the block module in Bifrost, which is a collection of previously-written blocks for various functionality,and -``views``, which is a library for manipulations of ring headers. +``views``, which is a library for manipulations of ring headers. +We'll also import the ``Pipeline`` class from bifrost to +improve readability: .. code:: python import bifrost.blocks as blocks import bifrost.views as views + from bifrost import Pipeline + +Before we start working with the data we want to initialize an +instance of the pipeline class with the default parameters: + +.. code:: python + + pipeline = Pipeline() + pipeline.as_default() Now, let's create our data "source," our source block. This is the block that feeds our pipeline with data. In this example, @@ -201,9 +208,17 @@ the header information, which contains the name of the original is the `channelized` version of the original music file. It is the frequency decomposition of the audio. +In order to tell the pipeline when to shutdown and to run: + +.. code:: python + + pipeline.shutdown_on_signals() + pipeline.run() + So, what have we done? We: -1. Read in the ``.wav`` file. +1. Initialized the pipeline. +#. Read in the ``.wav`` file. #. Copied the raw data to the GPU. #. Split the time axis into chunks which we could FFT over. #. FFT'd along this new axis. @@ -212,8 +227,9 @@ So, what have we done? We: #. Copied the data back to the CPU. #. Converted the data into integer data types. #. Wrote this data to a filterbank file. +#. Ran the pipeline -All the Code +All the Code for Your Pipeline ------------ For ease of reference, here is all the code at once: @@ -223,7 +239,10 @@ For ease of reference, here is all the code at once: import bifrost as bf import bifrost.blocks as blocks import bifrost.views as views + from bifrost import Pipeline + pipeline = Pipeline() + pipeline.as_default() raw_data = blocks.read_wav(['heyjude.wav'], gulp_nframe=4096) gpu_raw_data = blocks.copy(raw_data, space='cuda') chunked_data = views.split_axis(gpu_raw_data, 'time', 256, label='fine_time') @@ -234,6 +253,104 @@ For ease of reference, here is all the code at once: quantized = bf.blocks.quantize(host_transposed, 'i8') blocks.write_sigproc(quantized) - pipeline = bf.get_default_pipeline() pipeline.shutdown_on_signals() pipeline.run() + +Reading Back a Filterbank File +------------ + +In order to see what we have done, we can also read back the +file we just wrote. For this we will only need ``blocks``: + +.. code:: python + + import bifrost.blocks as blocks + +To visualize the results, we will import ``numpy`` +and ``matplotlib.pyplot``: + +.. code:: python + + import numpy as np + import matplotlib.pyplot as plt + +First, we will create a source block that will return the data from +the filterbank file: + +.. code:: python + + myfile = 'heyjude.wav.fil' + sigprocsource = blocks.read_sigproc(myfile, gulp_nframe=4096) + +Now we will create a file reader to read the file and use it to read +in all of the frames present in the file in order to get the data +and some header information from the filterbank file: + +.. code:: python + + filereader = sigprocsource.create_reader(myfile) + data = filereader.read(filereader.nframe()) + duration = filereader.duration() + +Making a Spectrograph/Waterfall Plot of the Results +------------ + +If we know the sample rate of the wav file we could set the x-axis +to correspond to frequencies, but for now we will just leave these +as channel numbers. For, the y-axis, however, we now know the duration +so we can label this axis in seconds. We store these values as numpy +arrays: + +.. code:: python + + freqaxis = np.arange(len(data[0,0,:]) + timeaxis = np.linspace(0,duration,len(date[:,0,0])) + +We now can prepare for plotting by making all of our data the same +shape with meshgrid and plotting the first channel with matplotlib: + +.. code:: python + + X,Y = np.meshgrid(freqaxis, timeaxis) + Z = data[:,0,:] # plot only one channel/polarization + fig = plt.figure() + lev = np.linspace(Z.min(), Z.max(), num=50) + cont = plt.contourf(X,Y,Z, levels=lev) + ax = plt.gca() + ax.set_xlabel('Frequency Channels') + ax.set_ylabel('Time (s)') + plt.colorbar(cont) + plt.show() + plt.close() + +If everything goes well we should see a figure similar to this one: + +.. image:: spectrum.png + +All the Code for Reading and Plotting the Results: +------------ + +.. code:: python + + import bifrost.blocks as blocks + import numpy as np + import matplotlib.pyplot as plt + myfile = 'heyjude.wav.fil' + sigprocsource = blocks.read_sigproc(myfile, gulp_nframe=4096) + filereader = sigprocsource.create_reader(myfile) + data = filereader.read(filereader.nframe()) + duration = filereader.duration() + freqaxis = np.arange(len(data[0,0,:]) + timeaxis = np.linspace(0,duration,len(date[:,0,0])) + X,Y = np.meshgrid(freqaxis, timeaxis) + Z = data[:,0,:] # plot only one channel/polarization + fig = plt.figure() + lev = np.linspace(Z.min(), Z.max(), num=50) + cont = plt.contourf(X,Y,Z, levels=lev) + ax = plt.gca() + ax.set_xlabel('Frequency Channels') + ax.set_ylabel('Time (s)') + plt.colorbar(cont) + plt.show() + plt.close() + diff --git a/docs/source/Getting-started-guide.rst b/docs/source/Getting-started-guide.rst index a4d8bf005..c8189cf31 100644 --- a/docs/source/Getting-started-guide.rst +++ b/docs/source/Getting-started-guide.rst @@ -21,8 +21,7 @@ but higher ones should also work. Python dependencies ~~~~~~~~~~~~~~~~~~~ -*Bifrost is written in Python 2.7. If you would like us to support -Python 3.x, please let us know your interest.* +*Bifrost is compatible with Python >3.6.* `pip `__ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +43,7 @@ numpy, matplotlib, contextlib2, simplejson, pint, graphviz, ctypesgen ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have already installed pip, this step should be as simple as -``pip install --user numpy matplotlib contextlib2 simplejson pint graphviz git+https://github.com/olsonse/ctypesgen.git@9bd2d249aa4011c6383a10890ec6f203d7b7990f``. +``pip install --user numpy matplotlib contextlib2 simplejson pint graphviz ctypesgen==1.0.2``. C++ dependencies ~~~~~~~~~~~~~~~~ @@ -59,8 +58,37 @@ try out a CPU-only version of Bifrost. Then, once you have that first experience, you can come back here for a speedup. If you are ready to work with a GPU, you will want to get the newest -`CUDA toolkit `__. Follow -the operating system-specific instructions to install. +`CUDA toolkit `__. Follow +the operating system-specific instructions to install. Be sure to install a +kernel driver that works with the version of toolkit that you are using since +version mismatches can lead to runtime errors. + +The table below indicates which CUDA toolkit and kernel driver versions Bifrost +has been tested against. + +.. csv-table:: + :header: "OS","Linux Kernel","Driver Version","GPU","Toolkit","Status" + :widths: 15,18,12,18,12,35 + + "Ubuntu 20.04","5.4.0-177-generic","520.61.05","RTX 2080Ti","11.0.3","Working" + "Ubuntu 20.04","5.4.0-177-generic","520.61.05","RTX 2080Ti","11.1.1","Working" + "Ubuntu 20.04","5.4.0-177-generic","520.61.05","RTX 2080Ti","11.2.2","Working" + "Ubuntu 20.04","5.4.0-177-generic","520.61.05","RTX 2080Ti","11.3.1","Working" + "Ubuntu 20.04","5.4.0-186-generic","470.239.06","Quadro K2200","11.4.4","Working" + "Ubuntu 20.04","5.4.0-186-generic","495.29.05","Quadro K2200","11.5.2","Working" + "Ubuntu 18.04","4.15.0-88-generic","510.85.02","A4000","11.6.124","Working" + "Ubuntu 18.04","4.15.0-88-generic","510.85.02","RTX 2080Ti","11.6.124","Working" + "Ubuntu 20.04","4.4.0-174-generic","525.147.05","Titan RTX","11.6.55","Working" + "Ubuntu 20.04","5.4.0-186-generic","520.61.05","Quadro K2200","11.8.0","Known FIR and FFT Problems" + "Debian 12","6.1.0-21-amd64","525.147.05 ","Quadro K2200","12.0.0","Working" + "Ubuntu 20.04","5.4.0-147-generic","525.125.06","A5000","12.0.140","Working" + "Ubuntu 20.04","5.4.0-144-generic","525.125.06","A5000","12.0.140","Working" + "Ubuntu 20.04","5.4.0-144-generic","525.147.05","A4000","12.0.140","Working" + "Debian 12","6.1.0-21-amd64","530.30.02","Quadro K2200","12.1.1","Working" + "Debian 12","6.1.0-21-amd64","535.104.05","Quadro K2200","12.2.2","FFT bug: zeroed out data" + "Debian 12","6.1.0-21-amd64","545.23.08","Quadro K2200","12.3.2","Working" + "Debian 12","6.1.0-21-amd64","550.54.15","Quadro K2200","12.4.1","Working" + "Ubuntu 22.04","5.15.0-106-generic","555.42.06","GTX 980","12.5","Working" Other Dependencies ^^^^^^^^^^^^^^^^^^ @@ -79,10 +107,25 @@ with ``git clone https://github.com/ledatelescope/bifrost``. -You will want to edit ``user.mk`` to suit your system. For example, if -you are not working with GPUs, uncomment the line: - -``#NOCUDA = 1 # Disable CUDA support``. +You will want to run `configure` to tailor Bifrost to you system. At the end of +`configure` you will get a summary of how Bifrost will be built: + +``` +... +config.status: creating src/bifrost/config.h +config.status: executing libtool commands + +configure: cuda: yes - 50 52 +configure: numa: yes +configure: hwloc: yes +configure: libvma: no +configure: python bindings: yes +configure: memory alignment: 4096 +configure: logging directory: /dev/shm/bifrost +configure: options: native + +Bifrost is now ready to be compiled. Please run 'make' +``` Now you can call ``make``, and ``make install`` to install Bifrost. diff --git a/docs/source/spectrum.png b/docs/source/spectrum.png new file mode 100644 index 000000000..fe687926e Binary files /dev/null and b/docs/source/spectrum.png differ diff --git a/docs/source/tools-intro.rst b/docs/source/tools-intro.rst index 86dfc463d..bbeee9460 100644 --- a/docs/source/tools-intro.rst +++ b/docs/source/tools-intro.rst @@ -28,16 +28,16 @@ first be generated using the nvprof command line tool: The generated .nvprof file can then be imported into the Visual Profiler for visualisation and analysis. -To obtain a more detailed profile of pipeline execution, rebuild the bifrost library -with the setting TRACE=1 (either by changing ``user.mk`` or by passing it as an -argument to the ``make`` command). +To obtain a more detailed profile of pipeline execution, reconfigure and rebuild +the bifrost library with "trace" enabled using `./configure --enable-trace`. Pipeline in /dev/shm -------------------- -Details about the currently running bifrost pipeline are available in the ``/dev/shm`` directory. -They are mapped into a directory structure (use the linux ``tree`` utility to view it): +Details about the currently running bifrost pipeline are available in the ``/dev/shm`` +directory on Linux. They are mapped into a directory structure (use the linux ``tree`` +utility to view it): .. code:: @@ -98,4 +98,3 @@ The main performance monitoring tools is ``like_top.py``. This is, as the name s * Reserve is the time spent waiting for output space to become available in the ring (i.e., waiting for downstream blocks). Note: The CPU fraction will probably be 100% on any GPU block because it's currently set to spin (busy loop) while waiting for the GPU. - diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..902621b55 --- /dev/null +++ b/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "ctypesgen": { + "flake": false, + "locked": { + "lastModified": 1575761084, + "narHash": "sha256-0VuIufvB1TYK8EXSFr8EegNxxRxnoHsxEKQX9y7LOdY=", + "owner": "ctypesgen", + "repo": "ctypesgen", + "rev": "b7ccd0764ef7d74e9ad5816924950d05b47ecc8c", + "type": "github" + }, + "original": { + "owner": "ctypesgen", + "ref": "ctypesgen-1.0.2", + "repo": "ctypesgen", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1658937758, + "narHash": "sha256-FxQB/tWX15Faq3GBM+qTfVzd9qJqy/3CEgBp2zpHeNc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8f73de28e63988da02426ebb17209e3ae07f103b", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1658611562, + "narHash": "sha256-jktQ3mRrFAiFzzmVxQXh+8IxZOEE4hfr7St3ncXeVy4=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "f436e6dbc10bb3500775785072a40eefe057b18e", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "ctypesgen": "ctypesgen", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..1971beac3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,357 @@ +{ + description = + "A stream processing framework for high-throughput applications."; + + inputs.ctypesgen = { + url = "github:ctypesgen/ctypesgen/ctypesgen-1.0.2"; + flake = false; + }; + + inputs.pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{ self, nixpkgs, pre-commit-hooks, ... }: + let + inherit (nixpkgs) lib; + + # Parse the version info in the AC_INIT declaration. + acVersion = lib.head + (builtins.match "AC_INIT\\(\\[bifrost], *\\[([.0-9]+)].*" (lib.head + (lib.filter (lib.strings.hasPrefix "AC_INIT") + (lib.splitString "\n" (lib.readFile ./configure.ac))))); + + # Add a git hash if available; but if repo isn't clean then flake won’t + # provide shortRev and version ends in ".dev". + version = "${acVersion}.dev" + + lib.optionalString (self ? shortRev) "+g${self.shortRev}"; + + compilerName = stdenv: + lib.replaceStrings [ "-wrapper" ] [ "" ] stdenv.cc.pname; + + # Can inspect the cuda version to guess at what architectures would be + # most useful. Take care not to instatiate the cuda package though, which + # would happen if you start inspecting header files or trying to run nvcc. + + defaultGpuArchs = cudatoolkit: + if lib.hasPrefix "11." cudatoolkit.version then [ + "80" + "86" + ] else [ + "70" + "75" + ]; + + # At time of writing (2022-03-24): + # PACKAGE VERSION ARCHS + # cudatoolkit │ │ + # ≡ ~_10 │ │ + # ≡ ~_10_2 10.2.89 30 32 35 37 50 52 53 60 61 62 70 72 75 + # cudatoolkit_11 │ │ (deprecated) + # ≡ ~_11_4 11.4.2 │ (35 37 50)52 53 60 61 62 70 72 75 80 86 87 + # cudatoolkit_11_5 11.5.0 │ (35 37 50)52 53 60 61 62 70 72 75 80 86 87 + # │ │*Experimented w/using all supported archs, but + # │ │ had to eliminate 87 because not in cufft lib. + + bifrost = { stdenv, ctags, ncurses, file, enableDebug ? false + , enablePython ? true, python3, enableCuda ? false, cudatoolkit + , util-linuxMinimal, gpuArchs ? defaultGpuArchs cudatoolkit }: + stdenv.mkDerivation { + name = lib.optionalString (!enablePython) "lib" + "bifrost-" + + compilerName stdenv + lib.versions.majorMinor stdenv.cc.version + + lib.optionalString enablePython + "-py${lib.versions.majorMinor python3.version}" + + lib.optionalString enableCuda + "-cuda${lib.versions.majorMinor cudatoolkit.version}" + + lib.optionalString enableDebug "-debug" + "-${version}"; + inherit version; + src = ./.; + buildInputs = [ stdenv ctags ncurses ] ++ lib.optionals enablePython [ + python3 + python3.pkgs.ctypesgen + python3.pkgs.setuptools + python3.pkgs.pip + python3.pkgs.wheel + ] ++ lib.optionals enableCuda [ cudatoolkit util-linuxMinimal ]; + propagatedBuildInputs = lib.optionals enablePython [ + python3.pkgs.contextlib2 + python3.pkgs.graphviz + python3.pkgs.matplotlib + python3.pkgs.numpy + python3.pkgs.pint + python3.pkgs.scipy + python3.pkgs.simplejson + ]; + patchPhase = + # libtool wants file command, and refers to it in /usr/bin + '' + sed -i 's:/usr/bin/file:${file}/bin/file:' configure + '' + + # Use pinned ctypesgen, not one from pypi. + '' + sed -i 's/ctypesgen==1.0.2/ctypesgen/' python/setup.py + '' + + # Mimic the process of buildPythonPackage, which explicitly + # creates wheel, then installs with pip. + '' + sed -i -e "s:build @PYBUILDFLAGS@:bdist_wheel:" \ + -e "s:@PYINSTALLFLAGS@ .:${ + lib.concatStringsSep " " [ + "--prefix=${placeholder "out"}" + "--no-index" + "--no-warn-script-location" + "--no-cache" + ] + } dist/*.whl:" \ + python/Makefile.in + ''; + # Had difficulty specifying this with configureFlags, because it + # wants to quote the args and that fails with spaces in gpuArchs. + configurePhase = lib.concatStringsSep " " + ([ "./configure" "--disable-static" ''--prefix="$out"'' ] + ++ lib.optionals enableDebug [ "--enable-debug" ] + ++ lib.optionals enableCuda [ + "--with-cuda-home=${cudatoolkit}" + ''--with-gpu-archs="${lib.concatStringsSep " " gpuArchs}"'' + "--with-nvcc-flags='-Wno-deprecated-gpu-targets'" + "LDFLAGS=-L${cudatoolkit}/lib/stubs" + ]); + preBuild = lib.optionalString enablePython '' + make -C python bifrost/libbifrost_generated.py + sed -e "s:^add_library_search_dirs(\[:&'$out/lib':" \ + -e 's:name_formats = \["%s":&,"lib%s","lib%s.so":' \ + -i python/bifrost/libbifrost_generated.py + ''; + # This can be a helpful addition to above sed; prints each path + # tried when loading library: + # -e "s:return self\.Lookup(path):print(path); &:" \ + makeFlags = + lib.optionals enableCuda [ "CUDA_LIBDIR64=$(CUDA_HOME)/lib" ]; + preInstall = '' + mkdir -p "$out/lib" + ''; + }; + + ctypesgen = + { buildPythonPackage, setuptools-scm, toml, glibc, stdenv, gcc }: + buildPythonPackage rec { + pname = "ctypesgen"; + # Setup tools won’t be able to run git describe to generate the + # version, but we can include the shortRev. + version = "1.0.2.dev+g${inputs.ctypesgen.shortRev}"; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + src = inputs.ctypesgen; + buildInputs = [ setuptools-scm toml ]; + postPatch = + # Version detection in the absence of ‘git describe’ is broken, + # even with an explicit VERSION file. + '' + sed -e 's/\(VERSION = \).*$/\1"${pname}-${version}"/' \ + -e 's/\(VERSION_NUMBER = \).*$/\1"${version}"/' \ + -i ctypesgen/version.py + '' + + # Test suite invokes ‘run.py’, replace that with actual script. + '' + sed -e "s:\(script = \).*:\1'${ + placeholder "out" + }/bin/ctypesgen':" \ + -e "s:run\.py:ctypesgen:" \ + -i ctypesgen/test/testsuite.py + '' + + # At runtime, ctypesgen invokes ‘gcc -E’. It won’t be available in + # the darwin stdenv so let's explicitly patch full path to gcc in + # nix store, making gcc a true prerequisite, which it is. There + # are also runs of gcc specified in test suite. + '' + sed -i 's:gcc -E:${gcc}/bin/gcc -E:' ctypesgen/options.py + '' + + # Some tests explicitly load ‘libm’ and ‘libc’. They won’t be + # found on NixOS unless we patch in the ‘glibc’ path. + lib.optionalString stdenv.isLinux '' + sed -e 's:libm.so.6:${glibc}/lib/&:' \ + -e 's:libc.so.6:${glibc}/lib/&:' \ + -i ctypesgen/test/testsuite.py + ''; + checkPhase = "python ctypesgen/test/testsuite.py"; + }; + + pyOverlay = self: _: { + ctypesgen = self.callPackage ctypesgen { }; + bifrost = self.toPythonModule (self.callPackage bifrost { + enablePython = true; + python3 = self.python; + }); + }; + + bifrost-doc = + { stdenv, python3, ctags, doxygen, docDir ? "/share/doc/bifrost" }: + stdenv.mkDerivation { + name = "bifrost-doc-${version}"; + inherit version; + src = ./.; + buildInputs = [ + ctags + doxygen + python3 + python3.pkgs.bifrost + python3.pkgs.sphinx + python3.pkgs.breathe + ]; + buildPhase = '' + make doc + make -C docs html + cd docs/build/html + mv _static static + mv _sources sources + find . -type f -exec sed -i \ + -e '/\(href\|src\)=\"\(\.\.\/\)\?_static/ s/_static/static/' \ + -e '/\(href\|src\)=\"\(\.\.\/\)\?_modules/ s/_modules/modules/' \ + -e '/\(href\|src\)=\"\(\.\.\/\)\?_sources/ s/_sources/sources/' \ + -e '/\$\.ajax\(.*\)_sources/ s/_sources/sources/' \ + {} \; + cd ../../.. + ''; + installPhase = '' + mkdir -p "$out${docDir}" + cp -r docs/build/html "$out${docDir}" + ''; + }; + + # Enable pre-configured packages for these systems. + eachSystem = do: + lib.genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system: + do (import nixpkgs { + inherit system; + config.allowUnfree = true; + overlays = lib.attrValues self.overlays; + })); + + # Which python3 packages should be modified by the overlay? + isPython = name: builtins.match "python3[0-9]*" name != null; + pythonAttrs = lib.filterAttrs (name: _: isPython name); + + in { + overlays.default = final: prev: + { + bifrost = final.callPackage bifrost { }; + bifrost-doc = final.callPackage bifrost-doc { }; + github_stats = final.writeShellScriptBin "github_stats" '' + ${final.python3.withPackages (p: [ p.PyGithub ])}/bin/python \ + ${tools/github_stats.py} "$@" + ''; + } + # Apply the python overlay to every python package set we find. + // lib.mapAttrs (_: py: py.override { packageOverrides = pyOverlay; }) + (pythonAttrs prev); + + packages = eachSystem (pkgs: + let + shortenPy = lib.replaceStrings [ "thon" ] [ "" ]; + + # Which cuda versions should be target by the packages? Let's just do + # the default 10 and 11. It's easy to generate other point releases + # from the overlay. (Versions prior to 10 are not supported anymore by + # nixpkgs.) + isCuda = name: builtins.match "cudaPackages(_1[01])" name != null; + shortenCuda = lib.replaceStrings [ "Packages" "_" ] [ "" "" ]; + cudaAttrs = lib.filterAttrs (name: pkg: + isCuda name && lib.elem pkgs.system pkg.cudatoolkit.meta.platforms) + pkgs; + + # Which C++ compilers can we build with? How to name them? + eachCxx = f: + lib.concatMap f (with pkgs; [ + stdenv + gcc8Stdenv + gcc9Stdenv + gcc10Stdenv + gcc11Stdenv + clang6Stdenv + clang7Stdenv + clang8Stdenv + clang9Stdenv + clang10Stdenv + ]); + cxxName = stdenv: + lib.optionalString (stdenv != pkgs.stdenv) + ("-" + compilerName stdenv + lib.versions.major stdenv.cc.version); + + eachBool = f: lib.concatMap f [ true false ]; + eachCuda = f: lib.concatMap f ([ null ] ++ lib.attrNames cudaAttrs); + eachConfig = f: + eachBool (enableDebug: + eachCuda (cuda: + eachCxx (stdenv: + f (cxxName stdenv + + lib.optionalString (cuda != null) "-${shortenCuda cuda}" + + lib.optionalString enableDebug "-debug") { + inherit stdenv enableDebug; + enableCuda = cuda != null; + cudatoolkit = pkgs.${cuda}.cudatoolkit; + }))); + + # Runnable ctypesgen per python. Though it's just the executable we + # need, it's possible something about ctypes library could change + # between releases. + cgens = lib.mapAttrs' (name: py: { + name = "ctypesgen-${shortenPy name}"; + value = py.pkgs.ctypesgen; + }) (pythonAttrs pkgs); + + # The whole set of bifrost packages, with or without python (and each + # python version), and for each configuration. + bfs = lib.listToAttrs (eachConfig (suffix: config: + [{ + name = "libbifrost${suffix}"; + value = + pkgs.bifrost.override (config // { enablePython = false; }); + }] ++ lib.mapAttrsToList (name: py: { + name = "bifrost-${shortenPy name}${suffix}"; + value = py.pkgs.bifrost.override config; + }) (pythonAttrs pkgs))); + + # Now generate pythons with bifrost packaged. + pys = lib.listToAttrs (eachConfig (suffix: config: + lib.mapAttrsToList (name: py: { + name = "${name}-bifrost${suffix}"; + value = (py.withPackages + (p: [ (p.bifrost.override config) ])).override { + makeWrapperArgs = lib.optionals config.enableCuda + [ "--set LD_PRELOAD /usr/lib/x86_64-linux-gnu/libcuda.so" ]; + }; + }) (pythonAttrs pkgs))); + + in { inherit (pkgs) bifrost-doc github_stats; } // cgens // bfs // pys); + + devShells = eachSystem (pkgs: { + default = let + pre-commit = pre-commit-hooks.lib.${pkgs.system}.run { + src = ./.; + hooks.nixfmt.enable = true; + hooks.nix-linter.enable = true; + hooks.yamllint.enable = true; + hooks.yamllint.excludes = [ ".github/workflows/main.yml" ]; + }; + + in pkgs.mkShellNoCC { + inherit (pre-commit) shellHook; + + # Tempting to include bifrost-doc.buildInputs here, but that requires + # bifrost to already be built. + buildInputs = pkgs.bifrost.buildInputs + ++ pkgs.bifrost.propagatedBuildInputs ++ [ + pkgs.black + pkgs.ctags + pkgs.doxygen + pkgs.nixfmt + pkgs.nix-linter + pkgs.python3.pkgs.breathe + pkgs.python3.pkgs.sphinx + pkgs.yamllint + pkgs.autoconf + ]; + }; + }); + }; +} diff --git a/lgtm.yml b/lgtm.yml new file mode 100644 index 000000000..b8a3dccb4 --- /dev/null +++ b/lgtm.yml @@ -0,0 +1,10 @@ +extraction: + cpp: + prepare: + packages: + - exuberant-ctags + before_index: + - export NOCUDA=1 + index: + build_command: + - make -e libbifrost diff --git a/python/Makefile b/python/Makefile deleted file mode 100644 index 6f41494ef..000000000 --- a/python/Makefile +++ /dev/null @@ -1,65 +0,0 @@ - -include ../config.mk - -INC_DIR = ../src - -BIFROST_PYTHON_VERSION_FILE = bifrost/version.py -BIFROST_PYTHON_BINDINGS_FILE = bifrost/libbifrost_generated.py - -PSRHOME ?= /usr/local -PSRDADA_PYTHON_BINDINGS_FILE = bifrost/libpsrdada_generated.py -PSRDADA_HEADERS = \ - $(PSRHOME)/include/dada_hdu.h \ - $(PSRHOME)/include/ipcio.h \ - $(PSRHOME)/include/ipcbuf.h \ - $(PSRHOME)/include/multilog.h - -all: build -.PHONY: all - -$(BIFROST_PYTHON_VERSION_FILE): ../config.mk - @echo "__version__ = \"$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR).$(LIBBIFROST_PATCH)\"" > $@ - -define run_ctypesgen - python -c 'from ctypesgen import main as ctypeswrap; ctypeswrap.main()' -l$1 -I$2 $^ -o $@ - # WAR for 'const char**' being generated as POINTER(POINTER(c_char)) instead of POINTER(c_char_p) - sed -i 's/POINTER(c_char)/c_char_p/g' $@ - # WAR for a buggy WAR in ctypesgen that breaks type checking and auto-byref functionality - sed -i 's/def POINTER/def POINTER_not_used/' $@ - # WAR for a buggy WAR in ctypesgen that breaks string buffer arguments (e.g., as in address.py) - sed -i 's/class String/String = c_char_p\nclass String_not_used/' $@ - sed -i 's/String.from_param/String_not_used.from_param/g' $@ - sed -i 's/def ReturnString/ReturnString = c_char_p\ndef ReturnString_not_used/' $@ - sed -i '/errcheck = ReturnString/s/^/#/' $@ -endef - -ifeq "$(wildcard $(PSRDADA_HEADERS))" "" -PSRDADA_PYTHON_BINDINGS_FILE = -endif - -$(PSRDADA_PYTHON_BINDINGS_FILE): $(PSRDADA_HEADERS) - $(call run_ctypesgen,psrdada,$(PSRHOME)/include) - # WAR for psrdada API using char* instead of void* for buffer pointers, which - # otherwise get inadvertently converted to Python strings. - sed -i 's/c_char_p/POINTER(c_char)/g' $@ - -$(BIFROST_PYTHON_BINDINGS_FILE): $(INC_DIR)/bifrost/*.h - $(call run_ctypesgen,$(BIFROST_NAME),$(INC_DIR)) - -build: bifrost/*.py Makefile $(BIFROST_PYTHON_VERSION_FILE) $(BIFROST_PYTHON_BINDINGS_FILE) $(PSRDADA_PYTHON_BINDINGS_FILE) - python setup.py build $(PYBUILDFLAGS) -.PHONY: build - -install: build - python setup.py install $(PYINSTALLFLAGS) -.PHONY: install - -clean: - python setup.py clean --all - rm -f $(BIFROST_PYTHON_VERSION_FILE) - rm -f $(BIFROST_PYTHON_BINDINGS_FILE) - rm -f $(PSRDADA_PYTHON_BINDINGS_FILE) -.PHONY: clean - -uninstall: - pip uninstall bifrost diff --git a/python/Makefile.in b/python/Makefile.in new file mode 100644 index 000000000..4ee2c30de --- /dev/null +++ b/python/Makefile.in @@ -0,0 +1,83 @@ + +include ../config.mk + +INC_DIR = ../src + +BIFROST_PYTHON_VERSION_FILE = bifrost/version/__init__.py +BIFROST_PYTHON_BINDINGS_FILE = bifrost/libbifrost_generated.py + +PSRHOME ?= /usr/local +PSRDADA_PYTHON_BINDINGS_FILE = bifrost/libpsrdada_generated.py +PSRDADA_HEADERS = \ + $(PSRHOME)/include/dada_hdu.h \ + $(PSRHOME)/include/ipcio.h \ + $(PSRHOME)/include/ipcbuf.h \ + $(PSRHOME)/include/multilog.h + +all: build +.PHONY: all + +$(BIFROST_PYTHON_VERSION_FILE): ../config.mk + @echo "__version__ = \"$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR).$(LIBBIFROST_PATCH)\"" > $@ + +define run_ctypesgen + # Build the libbifrost wrapper + @PYTHON@ -c 'from ctypesgen import main as ctypeswrap; ctypeswrap.main()' -l$1 -I$2 $^ -o $@ + # WAR for 'const char**' being generated as POINTER(POINTER(c_char)) instead of POINTER(c_char_p) + @SED@ -i.orig -e 's/POINTER(c_char)/c_char_p/g' $@ + # WAR for a buggy WAR in ctypesgen that breaks type checking and auto-byref functionality + @SED@ -i.orig -e 's/def POINTER/def POINTER_not_used/' $@ + # WAR for a buggy WAR in ctypesgen that breaks string buffer arguments (e.g., as in address.py) + @SED@ -i.orig -e 's/class String/String = c_char_p\nclass String_not_used/' $@ + @SED@ -i.orig -e 's/String.from_param/String_not_used.from_param/g' $@ + @SED@ -i.orig -e 's/def ReturnString/ReturnString = c_char_p\ndef ReturnString_not_used/' $@ + @SED@ -i.orig -e '/errcheck = ReturnString/s/^/#/' $@ +endef + +define run_typehinting + # Build the libbifrost typing hinting + @PYTHON@ -c 'from typehinting import build_typehinting; build_typehinting("$@")' +endef + +ifeq "$(wildcard $(PSRDADA_HEADERS))" "" +PSRDADA_PYTHON_BINDINGS_FILE = +endif + +$(PSRDADA_PYTHON_BINDINGS_FILE): $(PSRDADA_HEADERS) + $(call run_ctypesgen,psrdada,$(PSRHOME)/include) + # WAR for psrdada API using char* instead of void* for buffer pointers, which + # otherwise get inadvertently converted to Python strings. + @SED@ -i.orig -e 's/c_char_p/POINTER(c_char)/g' $@ + +$(BIFROST_PYTHON_BINDINGS_FILE): $(INC_DIR)/bifrost/*.h + $(call run_ctypesgen,$(BIFROST_NAME),$(INC_DIR)) + $(call run_typehinting,$(BIFROST_NAME),$(INC_DIR)) + +build: bifrost/*.py Makefile $(BIFROST_PYTHON_VERSION_FILE) $(BIFROST_PYTHON_BINDINGS_FILE) $(PSRDADA_PYTHON_BINDINGS_FILE) + @PYTHON@ setup.py build @PYBUILDFLAGS@ +.PHONY: build + +install: build + @@PYTHON@ -m pip install @PYINSTALLFLAGS@ . + @echo "*************************************************************************" + @echo "By default Bifrost installs with basic Python telemetry enabled in order" + @echo "to help inform how the software is used for future development. You can" + @echo "opt out of telemetry collection using:" + @echo "python -m bifrost.telemetry --disable" + @echo "*************************************************************************" + @echo "" + @echo "If you have trouble importing Bifrost from Python you may need" + @echo "to set LD_LIBRARY_PATH to $(INSTALL_LIB_DIR) or have your" + @echo "system administrator add this directory to '/etc/ld.so.conf'." + @echo "" +.PHONY: install + +clean: + @PYTHON@ setup.py clean --all + rm -f $(BIFROST_PYTHON_VERSION_FILE) + rm -f $(BIFROST_PYTHON_BINDINGS_FILE) + rm -f $(PSRDADA_PYTHON_BINDINGS_FILE) +.PHONY: clean + +uninstall: + @PYTHON@ -m pip uninstall bifrost diff --git a/python/bifrost/DataType.py b/python/bifrost/DataType.py index eb99c554b..06375ac1e 100644 --- a/python/bifrost/DataType.py +++ b/python/bifrost/DataType.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -38,17 +38,12 @@ cf32: 32+32-bit complex floating point """ -# Python2 compatibility -from __future__ import division, absolute_import -import sys -string_types = (str,) -if sys.version_info < (3,): - range = xrange - string_types = (basestring,) - -from bifrost.libbifrost import _bf +from bifrost.libbifrost import _bf, _th +from bifrost.libbifrost_generated import BF_FLOAT128_ENABLED import numpy as np +from typing import Optional, Union + from bifrost import telemetry telemetry.track_module() @@ -57,7 +52,7 @@ # E.g., np.ndarray([(0x10,), (0x32,)], dtype=ci4) # Special case # np.ndarray([ (0,1), (2,3)], dtype=ci8) # np.ndarray([ (0,1), (2,3)], dtype=ci16) -ci4 = np.dtype([('re_im', np.int8)]) +ci4 = np.dtype([('re_im', np.uint8)]) ci8 = np.dtype([('re', np.int8), ('im', np.int8)]) ci16 = np.dtype([('re', np.int16), ('im', np.int16)]) ci32 = np.dtype([('re', np.int32), ('im', np.int32)]) @@ -74,14 +69,17 @@ 16: _bf.BF_DTYPE_U16, 32: _bf.BF_DTYPE_U32, 64: _bf.BF_DTYPE_U64}, 'f': {16: _bf.BF_DTYPE_F16, 32: _bf.BF_DTYPE_F32, - 64: _bf.BF_DTYPE_F64, 128: _bf.BF_DTYPE_F128}, + 64: _bf.BF_DTYPE_F64}, 'ci': { 1: _bf.BF_DTYPE_CI1, 2: _bf.BF_DTYPE_CI2, 4: _bf.BF_DTYPE_CI4, 8: _bf.BF_DTYPE_CI8, 16: _bf.BF_DTYPE_CI16, 32: _bf.BF_DTYPE_CI32, 64: _bf.BF_DTYPE_CI64}, 'cf': {16: _bf.BF_DTYPE_CF16, 32: _bf.BF_DTYPE_CF32, - 64: _bf.BF_DTYPE_CF64, 128: _bf.BF_DTYPE_CF128} + 64: _bf.BF_DTYPE_CF64} } +if BF_FLOAT128_ENABLED: + TYPENAME['f'][128] = _bf.BF_DTYPE_F128 + TYPENAME['cf'][128] = _bf.BF_DTYPE_CF128 KINDMAP = { _bf.BF_DTYPE_INT_TYPE: 'i', _bf.BF_DTYPE_UINT_TYPE: 'u', @@ -93,7 +91,7 @@ 'u': { 8: np.uint8, 16: np.uint16, 32: np.uint32, 64: np.uint64}, 'f': {16: np.float16, 32: np.float32, - 64: np.float64, 128: np.float128}, + 64: np.float64}, # HACK: These are just types that match the storage size; # they should not be used for computation. # HACK TESTING to support 'packed' arrays @@ -104,10 +102,13 @@ 64: ci64}, # HACK: cf16 used as WAR for missing np.complex32 'cf': {16: cf16, 32: np.complex64, - 64: np.complex128, 128: np.complex256} + 64: np.complex128} } +if BF_FLOAT128_ENABLED: + NUMPY_TYPEMAP['f'][128] = np.float128 + NUMPY_TYPEMAP['cf'][128] = np.complex256 -def is_vector_structure(dtype): +def is_vector_structure(dtype: np.dtype) -> bool: if dtype.names is None: return False ndim = len(dtype.names) @@ -118,17 +119,17 @@ def is_vector_structure(dtype): class DataType(object): # Note: Default of None results in default Numpy type (np.float) - def __init__(self, t=None): - if isinstance(t, string_types): + def __init__(self, t: Optional[Union[str,_th.BFdtype_enum,_bf.BFdtype,"DataType",np.dtype]]=None): + if isinstance(t, str): for i, char in enumerate(t): if char.isdigit(): break self._kind = t[:i] self._nbit = int(t[i:]) self._veclen = 1 # TODO: Consider supporting this as part of string - elif isinstance(t, _bf.BFdtype): # Note: This is actually just a c_int - t = int(t) - self._nbit = t & BF_DTYPE_NBIT_BITS + elif isinstance(t, (_th.BFdtype_enum, _bf.BFdtype)): # Note: This is actually just a c_int + t = _th.BFdtype_enum(t).value + self._nbit = t & _bf.BF_DTYPE_NBIT_BITS is_complex = bool(t & _bf.BF_DTYPE_COMPLEX_BIT) self._kind = KINDMAP[t & _bf.BF_DTYPE_TYPE_BITS] if is_complex: @@ -150,10 +151,10 @@ def __init__(self, t=None): self._veclen = t.shape[0] t = t.base else: - raise TypeError("Unsupported Numpy dtype: " + str(t)) + raise TypeError(f"Unsupported Numpy dtype: {t}") self._nbit = t.itemsize * 8 if t.kind not in set(['i', 'u', 'f', 'c', 'V', 'b']): - raise TypeError('Unsupported data type: %s' % str(t)) + raise TypeError(f"Unsupported data type: {t}") if is_vector_structure(t): # Field structure representing vector self._veclen = len(t.names) t = t[0] @@ -168,7 +169,7 @@ def __init__(self, t=None): elif t in [cf16]: self._kind = 'cf' else: - raise TypeError('Unsupported data type: %s' % str(t)) + raise TypeError(f"Unsupported data type: {t}") elif t.kind == 'b': # Note: Represents booleans as uint8 inside Bifrost self._kind = 'u' @@ -178,10 +179,10 @@ def __eq__(self, other): self._veclen == other._veclen) def __ne__(self, other): return not (self == other) - def as_BFdtype(self): + def as_BFdtype(self) -> _bf.BFdtype: base = TYPEMAP[self._kind][self._nbit] return base | ((self._veclen - 1) << _bf.BF_DTYPE_VECTOR_BIT0) - def as_numpy_dtype(self): + def as_numpy_dtype(self) -> np.dtype: base = np.dtype(NUMPY_TYPEMAP[self._kind][self._nbit]) if self._veclen == 1: return base @@ -194,25 +195,25 @@ def as_numpy_dtype(self): return np.dtype(','.join((str(base),)*self._veclen)) def __str__(self): if self._veclen == 1: - return '%s%i' % (self._kind, self._nbit) + return f"{self._kind}{self._nbit}" else: - return '%s%i[%i]' % (self._kind, self._nbit, self._veclen) + return f"{self._kind}{self._nbit}[{self._veclen}]" @property - def is_complex(self): + def is_complex(self) -> bool: return self._kind[0] == 'c' @property - def is_real(self): + def is_real(self) -> bool: return not self.is_complex @property - def is_signed(self): + def is_signed(self) -> bool: return 'i' in self._kind or 'f' in self._kind @property - def is_floating_point(self): + def is_floating_point(self) -> bool: return 'f' in self._kind @property - def is_integer(self): + def is_integer(self) -> bool: return 'i' in self._kind or 'u' in self._kind - def as_floating_point(self): + def as_floating_point(self) -> "DataType": """Returns the smallest floating-point type that can represent all values that self can. """ @@ -221,32 +222,32 @@ def as_floating_point(self): kind = 'cf' if self.is_complex else 'f' nbit = 32 if self._nbit <= 24 else 64 return DataType((kind, nbit, self._veclen)) - def as_integer(self, nbit=None): + def as_integer(self, nbit: int=None) -> "DataType": if nbit is None: nbit = self._nbit kind = self._kind if self.is_floating_point: kind = kind.replace('f', 'i') return DataType((kind, nbit, self._veclen)) - def as_real(self): + def as_real(self) -> "DataType": if self.is_complex: return DataType((self._kind[1:], self._nbit, self._veclen)) else: return self - def as_complex(self): + def as_complex(self) -> "DataType": if self.is_complex: return self else: return DataType(('c' + self._kind, self._nbit, self._veclen)) - def as_nbit(self, nbit): + def as_nbit(self, nbit: int) -> "DataType": return DataType((self._kind, nbit, self._veclen)) - def as_vector(self, veclen): + def as_vector(self, veclen: int) -> "DataType": return DataType((self._kind, self._nbit, veclen)) @property - def itemsize_bits(self): + def itemsize_bits(self) -> int: return self._nbit * (1 + self.is_complex) * self._veclen @property - def itemsize(self): + def itemsize(self) -> int: item_nbit = self.itemsize_bits if item_nbit < 8: raise ValueError('itemsize is undefined when nbit < 8') diff --git a/python/bifrost/GPUArray.py b/python/bifrost/GPUArray.py deleted file mode 100644 index 504aae11e..000000000 --- a/python/bifrost/GPUArray.py +++ /dev/null @@ -1,122 +0,0 @@ - -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Bifrost Authors nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import numpy as np -from bifrost.memory import raw_malloc, raw_free, memset, memcpy, memcpy2D -from bifrost.array import _array2bifrost # This doesn't exist! - -from bifrost import telemetry -telemetry.track_module() - -class GPUArray(object): - def __init__(self, shape, dtype, buffer=None, offset=0, strides=None): - itemsize = dtype().itemsize - shape = tuple(np.array(shape).ravel().astype(np.uint64)) - if strides is None: - # This magic came from http://stackoverflow.com/a/32874295 - strides = itemsize * np.r_[1, np.cumprod(shape[::-1][:-1], - dtype=np.int64)][::-1] - self.shape = shape - self.dtype = dtype - self.buffer = buffer - self.offset = offset - self.strides = strides - self.base = None - self.flags = {'WRITEABLE': True, - 'ALIGNED': buffer % (itemsize == 0 - if buffer is not None - else True), - 'OWNDATA': False, - 'UPDATEIFCOPY': False, - 'C_CONTIGUOUS': self.nbytes == strides[0] * shape[0], - 'F_CONTIGUOUS': False, - 'SPACE': 'cuda'} - class CTypes(object): - def __init__(self, parent): - self.parent = parent - @property - def data(self): - return self.parent.data - self.ctypes = CTypes(self) - if self.buffer is None: - self.buffer = raw_malloc(self.nbytes, space='cuda') - self.flags['OWNDATA'] = True - self.flags['ALIGNED'] = True - memset(self, 0) - else: - self.buffer += offset - def __del__(self): - if self.flags['OWNDATA']: - raw_free(self.buffer, self.flags['SPACE']) - @property - def data(self): - return self.buffer - # def reshape(self, shape): - # # TODO: How to deal with strides? - # # May be non-contiguous but the reshape still works - # # E.g., splitting dims - # return GPUArray(shape, self.dtype, - # buffer=self.buffer, - # offset=self.offset, - # strides=self.strides) - @property - def size(self): - return int(np.prod(self.shape)) - @property - def itemsize(self): - return self.dtype().itemsize - @property - def nbytes(self): - return self.size * self.itemsize - @property - def ndim(self): - return len(self.shape) - def get(self, dst=None): - hdata = dst if dst is not None else np.empty(self.shape, self.dtype) - # hdata = dst if dst is not None else np.zeros(self.shape, self.dtype) - assert(hdata.shape == self.shape) - assert(hdata.dtype == self.dtype) - if self.flags['C_CONTIGUOUS'] and hdata.flags['C_CONTIGUOUS']: - memcpy(hdata, self) - elif self.ndim == 2: - memcpy2D(hdata, self) - else: - raise RuntimeError("Copying with this data layout is unsupported") - return hdata - def set(self, hdata): - assert(hdata.shape == self.shape) - hdata = hdata.astype(self.dtype) - if self.flags['C_CONTIGUOUS'] and hdata.flags['C_CONTIGUOUS']: - memcpy(self, hdata) - elif self.ndim == 2: - memcpy2D(self, hdata) - else: - raise RuntimeError("Copying with this data layout is unsupported") - return self - def as_BFarray(self): - return _array2bifrost(self) diff --git a/python/bifrost/Space.py b/python/bifrost/Space.py index 3945e8599..c5ef4b0d5 100644 --- a/python/bifrost/Space.py +++ b/python/bifrost/Space.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,38 +25,22 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from bifrost.libbifrost import _bf +from bifrost.libbifrost import _bf, _th + +from typing import Union from bifrost import telemetry telemetry.track_module() -SPACEMAP_TO_STR = {_bf.BF_SPACE_AUTO: 'auto', - _bf.BF_SPACE_SYSTEM: 'system', - _bf.BF_SPACE_CUDA: 'cuda', - _bf.BF_SPACE_CUDA_HOST: 'cuda_host', - _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed'} - -SPACEMAP_FROM_STR = {'auto': _bf.BF_SPACE_AUTO, - 'system': _bf.BF_SPACE_SYSTEM, - 'cuda': _bf.BF_SPACE_CUDA, - 'cuda_host': _bf.BF_SPACE_CUDA_HOST, - 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED} - class Space(object): - def __init__(self, s): + def __init__(self, s: Union[str,_th.BFspace_enum,_bf.BFspace]): if isinstance(s, str): - if s not in set(['auto', 'system', - 'cuda', 'cuda_host', 'cuda_managed']): - raise ValueError('Invalid space: %s' % s) - self._space = s - elif isinstance(s, _bf.BFspace) or isinstance(s, int): - if s not in SPACEMAP_TO_STR: - raise KeyError("Invalid space: " + s + - ". Valid spaces: " + str(SPACEMAP_TO_STR.keys())) - self._space = SPACEMAP_TO_STR[s] + self._space = getattr(_th.BFspace_enum, s) + elif isinstance(s, (_th.BFspace_enum, _bf.BFspace, int)): + self._space = _th.BFspace_enum(s) else: - raise ValueError('%s is not a space' % s) - def as_BFspace(self): - return SPACEMAP_FROM_STR[self._space] + raise ValueError(f"'{s}' is not a space") + def as_BFspace(self) -> _bf.BFspace: + return _bf.BFspace(self._space.value) def __str__(self): - return self._space + return self._space.name diff --git a/python/bifrost/__init__.py b/python/bifrost/__init__.py index 7151c8ad6..68589ed9d 100644 --- a/python/bifrost/__init__.py +++ b/python/bifrost/__init__.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,28 +32,27 @@ # TODO: Decide how to organise the namespace -from __future__ import print_function, absolute_import - from bifrost import core, memory, affinity, ring, block, address, udp_socket from bifrost import pipeline from bifrost import device from bifrost.ndarray import ndarray, asarray, empty_like, empty, zeros_like, zeros from bifrost import views -from bifrost.map import map +from bifrost.map import map, clear_map_cache, list_map_cache from bifrost.pipeline import Pipeline, get_default_pipeline, block_scope from bifrost import blocks from bifrost.block_chainer import BlockChainer from bifrost.reduce import reduce # import copy_block, transpose_block, scrunch_block, sigproc_block, fdmt_block -# from bifrost.transpose import transpose -# from bifrost.unpack import unpack -# from bifrost.quantize import quantize +from bifrost.transpose import transpose +from bifrost.unpack import unpack +from bifrost.quantize import quantize try: from bifrost.version import __version__ except ImportError: print("*************************************************************************") - print("Please run `make` from the root of the source tree to generate version.py") + print("Please run `configure` and `make` from the root of the source tree to") + print("generate the bifrost.version module.") print("*************************************************************************") raise __author__ = "The Bifrost Authors" diff --git a/python/bifrost/addon/leda/bandfiles.py b/python/bifrost/addon/leda/bandfiles.py index e83dee2ca..47268f0b0 100644 --- a/python/bifrost/addon/leda/bandfiles.py +++ b/python/bifrost/addon/leda/bandfiles.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -24,8 +24,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - import os, sys sys.path.append('..') @@ -48,9 +46,9 @@ def extract_obs_offset_from_name(fname): return int(os.path.basename(fname)[20:36]) def extract_obs_offset_in_file(fname): - f = open(fname, 'rb') - headerstr = f.read(DADA_HEADER_SIZE) - f.close() + with open(fname, 'rb') as f: + headerstr = f.read(DADA_HEADER_SIZE) + headerstr = headerstr.decode() if len(headerstr) < DADA_HEADER_SIZE: return "UNKNOWN" for line in headerstr.split('\n'): key, value = line.split() diff --git a/python/bifrost/addon/leda/blocks.py b/python/bifrost/addon/leda/blocks.py index 9980bc88d..6c72c6b31 100644 --- a/python/bifrost/addon/leda/blocks.py +++ b/python/bifrost/addon/leda/blocks.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -29,12 +29,6 @@ This file contains blocks specific to LEDA-OVRO. """ -# Python2 compatibility -from __future__ import print_function -import sys -if sys.version_info < (3,): - range = xrange - import os import bandfiles import bifrost @@ -120,7 +114,7 @@ def main(self, input_rings, output_rings): print("Opening", f.name) - with open(f.name,'rb') as ifile: + with open(f.name, 'rb') as ifile: ifile.read(self.HEADER_SIZE) ohdr["cfreq"] = f.freq diff --git a/python/bifrost/addon/leda/make_header.py b/python/bifrost/addon/leda/make_header.py index 26f009440..afd279385 100644 --- a/python/bifrost/addon/leda/make_header.py +++ b/python/bifrost/addon/leda/make_header.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -34,8 +34,6 @@ Makes header.txt files that is used by corr2uvfit and DuCT. """ -from __future__ import print_function, division - import numpy as np import os, sys, ephem, datetime from dateutil import tz @@ -72,9 +70,9 @@ def generate_info(self): based on what's in the header. For the rest, call them UNKNOWN. """ - f = open(self.filename, 'rb') - headerstr = f.read(self.DEFAULT_HEADER_SIZE) - f.close() + with open(self.filename, 'rb') as f: + headerstr = f.read(self.DEFAULT_HEADER_SIZE) + headerstr = headerstr.decode() header = {} for line in headerstr.split('\n'): @@ -270,28 +268,27 @@ def make_header(filename, write=True, warn=True, size=None): else: n_scans = str(int(header_params['N_SCANS'])) if write: # This format is used by corr2uvfits and DuCT for transforming a DADA file. - output = open("header.txt","w") - output.write("# Generated by make_header.py\n\n") - output.write("FIELDNAME Zenith\n") - output.write("N_SCANS "+n_scans+"\n") - output.write("N_INPUTS 512\n") - output.write("N_CHANS "+str(header_params['N_CHANS'])+" # number of channels in spectrum\n") - output.write("CORRTYPE B # correlation type to use. 'C'(cross), 'B'(both), or 'A'(auto)\n") - output.write("INT_TIME "+str(header_params['INT_TIME'])+" # integration time of scan in seconds\n") - output.write("FREQCENT "+str(header_params['FREQCENT'])+" # observing center freq in MHz\n") - output.write("BANDWIDTH "+str(header_params['BANDWIDTH'])+" # total bandwidth in MHz\n") - output.write("# To phase to the zenith, these must be the HA, RA and Dec of the zenith.\n") - output.write("HA_HRS 0.000000 # the RA of the desired phase centre (hours)\n") - output.write("RA_HRS "+header_params['RA_HRS']+" # the RA of the desired phase centre (hours)\n") - output.write("DEC_DEGS "+str(header_params['DEC_DEGS'])+" # the DEC of the desired phase centre (degs)\n") - output.write("DATE "+header_params['DATE']+" # YYYYMMDD\n") - output.write("TIME "+header_params['TIME']+" # HHMMSS\n") - output.write("LOCALTIME "+str(dada_times.localtime_str)+"\n") - output.write("LST "+str(dada_times.lst)+"\n") - output.write("INVERT_FREQ 0 # 1 if the freq decreases with channel number\n") - output.write("CONJUGATE 1 # conjugate the raw data to fix sign convention problem if necessary\n") - output.write("GEOM_CORRECT 0\n") - output.close() + with open('header.txt', 'w') as output: + output.write("# Generated by make_header.py\n\n") + output.write("FIELDNAME Zenith\n") + output.write("N_SCANS "+n_scans+"\n") + output.write("N_INPUTS 512\n") + output.write("N_CHANS "+str(header_params['N_CHANS'])+" # number of channels in spectrum\n") + output.write("CORRTYPE B # correlation type to use. 'C'(cross), 'B'(both), or 'A'(auto)\n") + output.write("INT_TIME "+str(header_params['INT_TIME'])+" # integration time of scan in seconds\n") + output.write("FREQCENT "+str(header_params['FREQCENT'])+" # observing center freq in MHz\n") + output.write("BANDWIDTH "+str(header_params['BANDWIDTH'])+" # total bandwidth in MHz\n") + output.write("# To phase to the zenith, these must be the HA, RA and Dec of the zenith.\n") + output.write("HA_HRS 0.000000 # the RA of the desired phase centre (hours)\n") + output.write("RA_HRS "+header_params['RA_HRS']+" # the RA of the desired phase centre (hours)\n") + output.write("DEC_DEGS "+str(header_params['DEC_DEGS'])+" # the DEC of the desired phase centre (degs)\n") + output.write("DATE "+header_params['DATE']+" # YYYYMMDD\n") + output.write("TIME "+header_params['TIME']+" # HHMMSS\n") + output.write("LOCALTIME "+str(dada_times.localtime_str)+"\n") + output.write("LST "+str(dada_times.lst)+"\n") + output.write("INVERT_FREQ 0 # 1 if the freq decreases with channel number\n") + output.write("CONJUGATE 1 # conjugate the raw data to fix sign convention problem if necessary\n") + output.write("GEOM_CORRECT 0\n") return header_params # If this function is called from other scripts (e.g. plot scripts) it can supply useful information diff --git a/python/bifrost/address.py b/python/bifrost/address.py index 73eec72e0..3c1c54b70 100644 --- a/python/bifrost/address.py +++ b/python/bifrost/address.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,52 +25,41 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info > (3,): - long = int - from bifrost.libbifrost import _bf, _check, _get, BifrostObject import ctypes -from socket import AF_UNSPEC +from socket import AddressFamily, AF_UNSPEC +from typing import Optional from bifrost import telemetry telemetry.track_module() class Address(BifrostObject): - def __init__(self, address, port, family=None): - try: - address = address.encode() - except AttributeError: - # Python2 catch - pass - assert(isinstance(port, (int, long))) + def __init__(self, address: str, port: int, family: Optional[AddressFamily]=None): + address = address.encode() + assert(isinstance(port, int)) if family is None: family = AF_UNSPEC BifrostObject.__init__( self, _bf.bfAddressCreate, _bf.bfAddressDestroy, address, port, family) @property - def family(self): + def family(self) -> int: return _get(_bf.bfAddressGetFamily, self.obj) @property - def port(self): + def port(self) -> int: return _get(_bf.bfAddressGetPort, self.obj) @property - def mtu(self): + def is_multicast(self) -> bool: + return True if _get(_bf.bfAddressIsMulticast, self.obj) else False + @property + def mtu(self) -> int: return _get(_bf.bfAddressGetMTU, self.obj) @property - def address(self): + def address(self) -> str: buflen = 128 buf = ctypes.create_string_buffer(buflen) _check(_bf.bfAddressGetString(self.obj, buflen, buf)) - try: - value = buf.value.decode() - except AttributeError: - # Python2 catch - value = buf.value - return value - def __str__(self): - return "%s:%i" % (self.address, self.port) + return buf.value.decode() + def __str__(self) -> str: + return f"{self.address}:{self.port}" diff --git a/python/bifrost/affinity.py b/python/bifrost/affinity.py index 99e67e762..5f5cedc77 100644 --- a/python/bifrost/affinity.py +++ b/python/bifrost/affinity.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,19 +26,18 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check, _get, _array +from typing import List + from bifrost import telemetry telemetry.track_module() -def get_core(): +def get_core() -> int: return _get(_bf.bfAffinityGetCore) -def set_core(core): +def set_core(core: int) -> None: _check(_bf.bfAffinitySetCore(core)) -def set_openmp_cores(cores): +def set_openmp_cores(cores: List[int]) -> None: # PYCLIBRARY ISSUE # TODO: Would be really nice to be able to directly pass # a list here instead of needing to specify _array+type. diff --git a/python/bifrost/block.py b/python/bifrost/block.py index cc63e218b..ce61b6935 100644 --- a/python/bifrost/block.py +++ b/python/bifrost/block.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,12 +31,6 @@ of a simple transform which works on a span by span basis. """ -# Python2 compatibility -from __future__ import print_function, division, absolute_import -import sys -if sys.version_info < (3,): - range = xrange - import json import threading import time @@ -48,6 +42,7 @@ from bifrost import affinity, memory from bifrost.ring import Ring from bifrost.sigproc import SigprocFile, unpack +from bifrost.libbifrost import EndOfDataStop from bifrost import telemetry telemetry.track_module() @@ -135,7 +130,7 @@ def insert_zeros_evenly(input_data, number_zeros): insert_index = np.floor( np.arange( number_zeros, - step=1.0) * float(input_data.size) / number_zeros) + step=1.0) * float(input_data.size) / number_zeros).astype(int) output_data = np.insert( input_data, insert_index, np.zeros(number_zeros)) @@ -227,7 +222,7 @@ def __init__(self, gulp_size=4096): self.core = -1 def load_settings(self, input_header): """Load in settings from input ring header""" - self.header = json.loads(input_header.tostring()) + self.header = json.loads(input_header.tobytes()) def iterate_ring_read(self, input_ring): """Iterate through one input ring @param[in] input_ring Ring to read through""" @@ -283,8 +278,11 @@ def izip(self, *iterables): into a single list generator""" iterators = [iter(iterable) for iterable in iterables] while True: - next_set = [next(iterator) for iterator in iterators] - yield self.flatten(*next_set) + try: + next_set = [next(iterator) for iterator in iterators] + yield self.flatten(*next_set) + except (EndOfDataStop, StopIteration): + return def load_settings(self): """Set by user to interpret input rings""" pass @@ -295,7 +293,7 @@ def read(self, *args): for ring_name in args]): # sequences is a tuple of all sequences for ring_name, sequence in self.izip(args, sequences): - self.header[ring_name] = json.loads(sequence.header.tostring()) + self.header[ring_name] = json.loads(sequence.header.tobytes()) self.load_settings() # resize all rings for ring_name in args: @@ -373,11 +371,11 @@ def __init__(self, sections): self.header['out_2']['shape'] = sections[1] def load_settings(self): """Set the gulp sizes appropriate to the input ring""" - self.gulp_size['in'] = np.product(self.header['in']['shape']) * self.header['in']['nbit'] // 8 - self.gulp_size['out_1'] = (self.gulp_size['in'] * np.product(self.header['out_1']['shape']) // - np.product(self.header['in']['shape'])) - self.gulp_size['out_2'] = (self.gulp_size['in'] * np.product(self.header['out_2']['shape']) // - np.product(self.header['in']['shape'])) + self.gulp_size['in'] = np.prod(self.header['in']['shape']) * self.header['in']['nbit'] // 8 + self.gulp_size['out_1'] = (self.gulp_size['in'] * np.prod(self.header['out_1']['shape']) // + np.prod(self.header['in']['shape'])) + self.gulp_size['out_2'] = (self.gulp_size['in'] * np.prod(self.header['out_2']['shape']) // + np.prod(self.header['in']['shape'])) def main(self): """Split the incoming ring into the outputs rings""" for inspan, outspan1, outspan2 in self.izip( @@ -450,8 +448,8 @@ def __init__(self, filename): def load_settings(self, input_header): """Load the header from json @param[in] input_header The header from the ring""" - write_file = open(self.filename, 'w') - write_file.write(str(json.loads(input_header.tostring()))) + with open(self.filename, 'w') as write_file: + write_file.write(str(json.loads(input_header.tobytes()))) def main(self, input_ring): """Put the header into the file @param[in] input_ring Contains the header in question""" @@ -466,7 +464,7 @@ def __init__(self, gulp_size): self.dtype = np.uint8 self.shape = (1, 1) def load_settings(self, input_header): - header = json.loads(input_header.tostring()) + header = json.loads(input_header.tobytes()) self.nbit = header['nbit'] self.dtype = np.dtype(header['dtype'].split()[1].split(".")[1].split("'")[0]).type if 'frame_shape' in header: @@ -506,7 +504,7 @@ def __init__(self, gulp_size): self.nbit = 8 self.dtype = np.uint8 def load_settings(self, input_header): - header = json.loads(input_header.tostring()) + header = json.loads(input_header.tobytes()) self.nbit = header['nbit'] try: self.dtype = np.dtype(header['dtype']).type @@ -551,7 +549,7 @@ def __init__(self, filename, gulp_size=1048576): self.dtype = np.uint8 open(self.filename, "w").close() # erase file def load_settings(self, input_header): - header_dict = json.loads(input_header.tostring()) + header_dict = json.loads(input_header.tobytes()) self.nbit = header_dict['nbit'] try: self.dtype = np.dtype(header_dict['dtype']).type @@ -579,9 +577,8 @@ def main(self, input_ring): data_accumulate = np.concatenate((data_accumulate, unpacked_data[0])) else: data_accumulate = unpacked_data[0] - text_file = open(self.filename, 'a') - np.savetxt(text_file, data_accumulate.reshape((1, -1))) - text_file.close() + with open(self.filename, 'a') as text_file: + np.savetxt(text_file, data_accumulate.reshape((1, -1))) class CopyBlock(TransformBlock): """Copies input ring's data to the output ring""" def __init__(self, gulp_size=1048576): @@ -656,7 +653,7 @@ def __init__(self, gulp_size=1048576, core=-1): self.dtype = np.uint8 def load_settings(self, input_header): self.output_header = input_header - self.settings = json.loads(input_header.tostring()) + self.settings = json.loads(input_header.tobytes()) self.nchan = self.settings["frame_shape"][0] dtype_str = self.settings["dtype"].split()[1].split(".")[1].split("'")[0] self.dtype = np.dtype(dtype_str) @@ -913,8 +910,8 @@ def __init__(self, function, inputs=1, outputs=1): @param[in] outputs The number of output rings and the number of output numpy arrays from the function.""" super(NumpyBlock, self).__init__() - self.inputs = ['in_%d' % (i + 1) for i in range(inputs)] - self.outputs = ['out_%d' % (i + 1) for i in range(outputs)] + self.inputs = [f"in_{i + 1}" for i in range(inputs)] + self.outputs = [f"out_{i + 1}" for i in range(outputs)] self.ring_names = {} self.create_ring_names() self.function = function @@ -1013,7 +1010,7 @@ def __init__(self, generator, outputs=1, grab_headers=False, changing=True): equal to the number of outgoing rings attached to this block. @param[in] changing Whether or not the arrays will be different in shape""" super(NumpySourceBlock, self).__init__() - outputs = ['out_%d' % (i + 1) for i in range(outputs)] + outputs = [f"out_{i + 1}" for i in range(outputs)] self.ring_names = {} for output_name in outputs: ring_description = "Output number " + output_name[4:] @@ -1029,7 +1026,7 @@ def calculate_output_settings(self, arrays): @param[in] arrays The arrays outputted by self.generator""" for index in range(len(self.ring_names)): assert isinstance(arrays[index], np.ndarray) - ring_name = 'out_%d' % (index + 1) + ring_name = f"out_{index + 1}" self.header[ring_name] = { 'dtype': str(arrays[index].dtype), 'shape': list(arrays[index].shape), @@ -1041,7 +1038,7 @@ def load_user_headers(self, headers, arrays): @param[in] headers List of dictionaries from self.generator for each ring's sequence header""" for i, header in enumerate(headers): - ring_name = 'out_%d' % (i + 1) + ring_name = f"out_{i + 1}" for parameter in header: self.header[ring_name][parameter] = header[parameter] if 'dtype' in header: @@ -1064,9 +1061,9 @@ def main(self): if self.grab_headers: self.load_user_headers(headers, arrays) - for outspans in self.write(*['out_%d' % (i + 1) for i in range(len(self.ring_names))]): + for outspans in self.write(*[f"out_{i + 1}" for i in range(len(self.ring_names))]): for i in range(len(self.ring_names)): - dtype = self.header['out_%d' % (i + 1)]['dtype'] + dtype = self.header[f"out_{i + 1}"]['dtype'] outspans[i][:] = arrays[i].astype(np.dtype(dtype).type).ravel() try: @@ -1080,7 +1077,7 @@ def main(self): arrays = [output_data] else: arrays = output_data - except StopIteration: + except (EndOfDataStop, StopIteration): break if self.changing: diff --git a/python/bifrost/block_chainer.py b/python/bifrost/block_chainer.py index b9332e729..e331851a0 100644 --- a/python/bifrost/block_chainer.py +++ b/python/bifrost/block_chainer.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - import bifrost from bifrost import telemetry diff --git a/python/bifrost/blocks/__init__.py b/python/bifrost/blocks/__init__.py index 03cf2600a..d786e2f5c 100644 --- a/python/bifrost/blocks/__init__.py +++ b/python/bifrost/blocks/__init__.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.blocks.copy import copy, CopyBlock from bifrost.blocks.transpose import transpose, TransposeBlock from bifrost.blocks.reverse import reverse, ReverseBlock @@ -53,10 +51,10 @@ try: # Avoid error if portaudio library not installed from bifrost.blocks.audio import read_audio, AudioSourceBlock -except: +except (ImportError, OSError): pass try: # Avoid error if psrdada library not installed from bifrost.blocks.psrdada import read_psrdada_buffer, PsrDadaSourceBlock -except: +except (ImportError, OSError): pass diff --git a/python/bifrost/blocks/accumulate.py b/python/bifrost/blocks/accumulate.py index 00df19257..381f9c841 100644 --- a/python/bifrost/blocks/accumulate.py +++ b/python/bifrost/blocks/accumulate.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -30,9 +30,7 @@ nframe times before outputting the accumulated result. """ -from __future__ import absolute_import - -import bifrost as bf +from bifrost.map import map as bf_map from bifrost.pipeline import TransformBlock from copy import deepcopy @@ -53,7 +51,6 @@ def define_valid_input_spaces(self): return ('cuda',) def on_sequence(self, iseq): ihdr = iseq.header - itensor = ihdr['_tensor'] ohdr = deepcopy(ihdr) otensor = ohdr['_tensor'] if 'scales' in otensor: @@ -67,7 +64,7 @@ def on_data(self, ispan, ospan): idata = ispan.data odata = ospan.data beta = 0. if self.frame_count == 0 else 1. - bf.map("b = beta * b + (b_type)a", {'a': idata, 'b': odata, 'beta': beta}) + bf_map("b = beta * b + (b_type)a", {'a': idata, 'b': odata, 'beta': beta}) self.frame_count += 1 if self.frame_count == self.nframe: ncommit = 1 diff --git a/python/bifrost/blocks/audio.py b/python/bifrost/blocks/audio.py index 1db0ffbf0..f083e9418 100644 --- a/python/bifrost/blocks/audio.py +++ b/python/bifrost/blocks/audio.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.pipeline import SourceBlock import bifrost.portaudio as audio diff --git a/python/bifrost/blocks/binary_io.py b/python/bifrost/blocks/binary_io.py index 7c3b68faf..bbcbba515 100644 --- a/python/bifrost/blocks/binary_io.py +++ b/python/bifrost/blocks/binary_io.py @@ -32,7 +32,7 @@ """ import numpy as np import bifrost.pipeline as bfp -from bifrost.dtype import name_nbit2numpy +from bifrost.DataType import DataType from bifrost import telemetry telemetry.track_module() @@ -60,7 +60,7 @@ def __enter__(self): return self def close(self): - pass + self.file_obj.close() def __exit__(self, type, value, tb): self.close() @@ -76,7 +76,7 @@ def create_reader(self, filename): # Do a lookup on bifrost datatype to numpy datatype dcode = self.dtype.rstrip('0123456789') nbits = int(self.dtype[len(dcode):]) - np_dtype = name_nbit2numpy(dcode, nbits) + np_dtype = DataType(dcode+str(nbits)).as_numpy_dtype() return BinaryFileRead(filename, self.gulp_size, np_dtype) @@ -108,6 +108,12 @@ def __init__(self, iring, file_ext='out', *args, **kwargs): self.current_fileobj = None self.file_ext = file_ext + def __del__(self): + try: + self.current_fileobj.close() + except AttributeError: + pass + def on_sequence(self, iseq): if self.current_fileobj is not None: self.current_fileobj.close() diff --git a/python/bifrost/blocks/convert_visibilities.py b/python/bifrost/blocks/convert_visibilities.py index 495b8e863..2404ba20a 100644 --- a/python/bifrost/blocks/convert_visibilities.py +++ b/python/bifrost/blocks/convert_visibilities.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,11 +25,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - +from bifrost.map import map as bf_map from bifrost.pipeline import TransformBlock from bifrost.DataType import DataType -import bifrost as bf from copy import deepcopy from math import sqrt @@ -98,7 +96,7 @@ def on_data(self, ispan, ospan): del shape_nopols[3] idata = idata.view(itype.as_vector(2)) odata = odata.view(otype.as_vector(2)) - bf.map( + bf_map( ''' bool in_lower_triangle = (i > j); if( in_lower_triangle ) { @@ -125,7 +123,7 @@ def on_data(self, ispan, ospan): idata = idata.view(itype.as_vector(2)) odata = odata.view(otype.as_vector(4)) # TODO: Support L/R as well as X/Y pols - bf.map(''' + bf_map(''' // TODO: This only works up to 2048 in single-precision #define project_triangular(i, j) ((i)*((i)+1)/2 + (j)) int i = int((sqrt(8.f*(b)+1)-1)/2); @@ -152,7 +150,7 @@ def on_data(self, ispan, ospan): del oshape_nopols[3] idata = idata.view(itype.as_vector(4)) odata = odata.view(otype.as_vector(2)) - bf.map(''' + bf_map(''' bool in_upper_triangle = (i < j); auto b = in_upper_triangle ? j*(j+1)/2 + i : i*(i+1)/2 + j; auto IQUV = idata(t,b,c,0); diff --git a/python/bifrost/blocks/copy.py b/python/bifrost/blocks/copy.py index 0a6a6cf6a..4e15030c2 100644 --- a/python/bifrost/blocks/copy.py +++ b/python/bifrost/blocks/copy.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.pipeline import TransformBlock from bifrost.ndarray import copy_array diff --git a/python/bifrost/blocks/correlate.py b/python/bifrost/blocks/correlate.py index fb29d5a66..246487729 100644 --- a/python/bifrost/blocks/correlate.py +++ b/python/bifrost/blocks/correlate.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,12 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info < (3,): - range = xrange - from bifrost.pipeline import TransformBlock from bifrost.linalg import LinAlg diff --git a/python/bifrost/blocks/detect.py b/python/bifrost/blocks/detect.py index 6bb183d3a..bf3cbb125 100644 --- a/python/bifrost/blocks/detect.py +++ b/python/bifrost/blocks/detect.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -24,24 +24,19 @@ # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info < (3,): - range = xrange -import bifrost as bf +from bifrost.map import map as bf_map from bifrost.pipeline import TransformBlock from bifrost.DataType import DataType from copy import deepcopy +from typing import Optional, Union from bifrost import telemetry telemetry.track_module() class DetectBlock(TransformBlock): - def __init__(self, iring, mode, axis=None, + def __init__(self, iring, mode: str, axis: Optional[Union[int,str]] = None, *args, **kwargs): super(DetectBlock, self).__init__(iring, *args, **kwargs) self.specified_axis = axis @@ -62,7 +57,7 @@ def on_sequence(self, iseq): self.mode != 'scalar' and 'pol' in itensor['labels']): self.axis = itensor['labels'].index('pol') - elif isinstance(self.axis, str): + elif isinstance(self.axis, basestring): self.axis = itensor['labels'].index(self.axis) # Note: axis may be None here, which indicates single-pol mode ohdr = deepcopy(ihdr) @@ -71,8 +66,10 @@ def on_sequence(self, iseq): self.npol = otensor['shape'][self.axis] if self.npol not in [1, 2]: raise ValueError("Axis must have length 1 or 2") - if self.mode == 'stokes' and self.npol == 2: + if (self.mode == 'stokes' or self.mode == 'coherence') and self.npol == 2: otensor['shape'][self.axis] = 4 + if self.mode == 'stokes_i' and self.npol == 2: + otensor['shape'][self.axis] = 1 if 'labels' in otensor: otensor['labels'][self.axis] = 'pol' else: @@ -87,7 +84,7 @@ def on_data(self, ispan, ospan): idata = ispan.data odata = ospan.data if self.npol == 1: - bf.map("b = Complex(a).mag2()", {'a': idata, 'b': odata}) + bf_map("b = Complex(a).mag2()", {'a': idata, 'b': odata}) else: shape = idata.shape[:self.axis] + idata.shape[self.axis + 1:] inds = ['i%i' % i for i in range(idata.ndim)] @@ -115,32 +112,47 @@ def on_data(self, ispan, ospan): b(%s) = -2*xy.imag; """ % (inds_[0], inds_[1], inds_[0], inds_[1], inds_[2], inds_[3]) - bf.map(func, shape=shape, axis_names=inds, + elif self.mode == 'stokes_i': + func = """ + Complex x = a(%s); + Complex y = a(%s); + auto xx = x.mag2(); + auto yy = y.mag2(); + b(%s) = xx + yy; + """ % (inds_[0], inds_[1], + inds_[0]) + elif self.mode == 'coherence': + func = """ + Complex x = a(%s); + Complex y = a(%s); + auto xx = x.mag2(); + auto yy = y.mag2(); + auto xy = x.conj()*y; + b(%s) = xx; + b(%s) = yy; + b(%s) = xy.real; + b(%s) = xy.imag; + """ % (inds_[0], inds_[1], + inds_[0], inds_[1], inds_[2], inds_[3]) + bf_map(func, shape=shape, axis_names=inds, data={'a': ispan.data, 'b': ospan.data}) -def detect(iring, mode, axis=None, *args, **kwargs): +def detect(iring, mode: str, axis: Optional[Union[int,str]] = None, *args, **kwargs): """Apply square-law detection to create polarization products. - Args: iring (Ring or Block): Input data source. mode (string): - ``'scalar': x -> real x.x*`` - ``'jones': x,y -> complex x.x* + 1j*y.y*, x.y*`` - ``'stokes': x,y -> real I, Q, U, V`` - + ``'stokes_I': x,y -> x.x* + y.y* (Stokes I)`` axis: Integer or string specifying the polarization axis. Defaults to 'pol'. Not used if mode = 'scalar'. *args: Arguments to ``bifrost.pipeline.TransformBlock``. **kwargs: Keyword Arguments to ``bifrost.pipeline.TransformBlock``. - **Tensor semantics**:: - Input: [..., 'pol', ...], dtype = any complex, space = CUDA Output: [..., 'pol', ...], dtype = real or complex, space = CUDA - Returns: DetectBlock: A new block instance. """ diff --git a/python/bifrost/blocks/fdmt.py b/python/bifrost/blocks/fdmt.py index a86e99102..65b0e1e0c 100644 --- a/python/bifrost/blocks/fdmt.py +++ b/python/bifrost/blocks/fdmt.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.pipeline import TransformBlock from bifrost.fdmt import Fdmt from bifrost.units import convert_units diff --git a/python/bifrost/blocks/fft.py b/python/bifrost/blocks/fft.py index 2e2e7a12d..42fa4c7d2 100644 --- a/python/bifrost/blocks/fft.py +++ b/python/bifrost/blocks/fft.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.pipeline import TransformBlock from bifrost.fft import Fft from bifrost.units import transform_units diff --git a/python/bifrost/blocks/fftshift.py b/python/bifrost/blocks/fftshift.py index 296b880fc..0cf8fc400 100644 --- a/python/bifrost/blocks/fftshift.py +++ b/python/bifrost/blocks/fftshift.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,13 +25,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info < (3,): - range = xrange - -import bifrost as bf +from bifrost.map import map as bf_map from bifrost.pipeline import TransformBlock from copy import deepcopy @@ -82,7 +76,7 @@ def on_data(self, ispan, ospan): else: inds[ax] += '-a.shape(%i)/2' % ax inds = ','.join(inds) - bf.map("b = a(%s)" % inds, shape=shape, axis_names=ind_names, + bf_map("b = a(%s)" % inds, shape=shape, axis_names=ind_names, data={'a': idata, 'b': odata}) def fftshift(iring, axes, inverse=False, *args, **kwargs): diff --git a/python/bifrost/blocks/guppi_raw.py b/python/bifrost/blocks/guppi_raw.py index 870a2c7cb..9085cb7dd 100644 --- a/python/bifrost/blocks/guppi_raw.py +++ b/python/bifrost/blocks/guppi_raw.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.pipeline import SourceBlock import bifrost.guppi_raw as guppi_raw diff --git a/python/bifrost/blocks/print_header.py b/python/bifrost/blocks/print_header.py index 1f9ae864a..ae46495bb 100644 --- a/python/bifrost/blocks/print_header.py +++ b/python/bifrost/blocks/print_header.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -24,7 +24,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import import pprint from bifrost.pipeline import SinkBlock diff --git a/python/bifrost/blocks/psrdada.py b/python/bifrost/blocks/psrdada.py index ca159d29e..6965e7f3f 100644 --- a/python/bifrost/blocks/psrdada.py +++ b/python/bifrost/blocks/psrdada.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - from bifrost.pipeline import SourceBlock from bifrost.Space import Space from bifrost.psrdada import Hdu diff --git a/python/bifrost/blocks/quantize.py b/python/bifrost/blocks/quantize.py index 5cc07d432..ffc25b188 100644 --- a/python/bifrost/blocks/quantize.py +++ b/python/bifrost/blocks/quantize.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,27 +25,29 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - -import bifrost as bf +from bifrost.quantize import quantize as bf_quantize from bifrost.pipeline import TransformBlock from bifrost.DataType import DataType +from bifrost.ring2 import Ring, ReadSequence, ReadSpan, WriteSpan from copy import deepcopy +import numpy as np + +from typing import Any, Dict, Union, Tuple from bifrost import telemetry telemetry.track_module() class QuantizeBlock(TransformBlock): - def __init__(self, iring, dtype, scale=1., + def __init__(self, iring: Ring, dtype: Union[str,np.dtype], scale: float=1., *args, **kwargs): super(QuantizeBlock, self).__init__(iring, *args, **kwargs) self.dtype = dtype self.scale = scale - def define_valid_input_spaces(self): + def define_valid_input_spaces(self) -> Tuple[str]: """Return set of valid spaces (or 'any') for each input""" - return ('system',) - def on_sequence(self, iseq): + return ('any',) + def on_sequence(self, iseq: ReadSequence) -> Dict[str,Any]: ihdr = iseq.header ohdr = deepcopy(ihdr) itype = DataType(ihdr['_tensor']['dtype']) @@ -58,12 +60,12 @@ def on_sequence(self, iseq): otype = self.dtype ohdr['_tensor']['dtype'] = otype return ohdr - def on_data(self, ispan, ospan): + def on_data(self, ispan: ReadSpan, ospan: WriteSpan) -> None: idata = ispan.data odata = ospan.data - bf.quantize.quantize(idata, odata, self.scale) + bf_quantize(idata, odata, self.scale) -def quantize(iring, dtype, scale=1., *args, **kwargs): +def quantize(iring: Ring, dtype: Union[str,np.dtype], scale: float=1., *args, **kwargs) -> QuantizeBlock: """Apply a requantization of bit depth for the data. Args: @@ -75,10 +77,10 @@ def quantize(iring, dtype, scale=1., *args, **kwargs): **Tensor semantics**:: - Input: [...], dtype = [c]f32, space = SYSTEM - Output: [...], dtype = any (complex) integer type, space = SYSTEM + Input: [...], dtype = [c]f32, space = SYSTEM or CUDA + Output: [...], dtype = any (complex) integer type, space = SYSTEM or CUDA Returns: QuantizeBlock: A new block instance. """ - return QuantizeBlock(iring, dtype, *args, **kwargs) + return QuantizeBlock(iring, dtype, scale, *args, **kwargs) diff --git a/python/bifrost/blocks/reduce.py b/python/bifrost/blocks/reduce.py index 1351ce5df..93a884d00 100644 --- a/python/bifrost/blocks/reduce.py +++ b/python/bifrost/blocks/reduce.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,10 +28,8 @@ # TODO: Consider merging with detect_block # Seems easy, but may end up somewhat complicated -from __future__ import absolute_import - +from bifrost.reduce import reduce as bf_reduce from bifrost.pipeline import TransformBlock -import bifrost as bf from copy import deepcopy @@ -82,7 +80,7 @@ def define_output_nframes(self, input_nframe): return output_nframe def on_data(self, ispan, ospan): idata, odata = ispan.data, ospan.data - bf.reduce(idata, odata, self.op) + bf_reduce(idata, odata, self.op) # TODO: Support system space using Numpy #ishape = list(idata.shape) diff --git a/python/bifrost/blocks/reverse.py b/python/bifrost/blocks/reverse.py index 1583aa230..4641c7e0b 100644 --- a/python/bifrost/blocks/reverse.py +++ b/python/bifrost/blocks/reverse.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,13 +25,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info < (3,): - range = xrange - -import bifrost as bf +from bifrost.map import map as bf_map from bifrost.pipeline import TransformBlock from copy import deepcopy @@ -76,7 +70,7 @@ def on_data(self, ispan, ospan): for ax in self.axes: inds[ax] = '-' + inds[ax] inds = ','.join(inds) - bf.map("b = a(%s)" % inds, shape=shape, axis_names=ind_names, + bf_map("b = a(%s)" % inds, shape=shape, axis_names=ind_names, data={'a': idata, 'b': odata}) def reverse(iring, axes, *args, **kwargs): diff --git a/python/bifrost/blocks/scrunch.py b/python/bifrost/blocks/scrunch.py index 9956f2bb0..0068b6cbd 100644 --- a/python/bifrost/blocks/scrunch.py +++ b/python/bifrost/blocks/scrunch.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,8 +28,6 @@ # TODO: This is a bit hacky and inflexible, and has no CUDA backend yet # **DEPRECATE it in favour of ReduceBlock -from __future__ import absolute_import - from bifrost.pipeline import TransformBlock from copy import deepcopy diff --git a/python/bifrost/blocks/serialize.py b/python/bifrost/blocks/serialize.py index b80eae5e6..652b57856 100644 --- a/python/bifrost/blocks/serialize.py +++ b/python/bifrost/blocks/serialize.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,22 +25,20 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import, print_function -import sys -if sys.version_info < (3,): - range = xrange - from bifrost.pipeline import SinkBlock, SourceBlock +from bifrost.ring2 import Ring, ReadSequence, ReadSpan, WriteSpan import os +import warnings try: import simplejson as json except ImportError: - print("WARNING: Install simplejson for better performance") + warnings.warn("Install simplejson for better performance", RuntimeWarning) import json import glob from functools import reduce +from typing import Any, Dict, List, Optional + from bifrost import telemetry telemetry.track_module() @@ -51,7 +49,7 @@ def _parse_bifrost_filename(fname): return frame0, ringlet_inds class BifrostReader(object): - def __init__(self, basename): + def __init__(self, basename: str): assert(basename.endswith('.bf')) hdr_filename = basename + '.json' with open(hdr_filename, 'r') as hdr_file: @@ -90,7 +88,7 @@ def __exit__(self, type, value, tb): else: for f in self.files: f.close() - def readinto(self, buf, frame_nbyte): + def readinto(self, buf: memoryview, frame_nbyte: int) -> int: if self.cur_file == self.nfile: return 0 nframe_read = 0 @@ -105,7 +103,7 @@ def readinto(self, buf, frame_nbyte): if nbyte_read % frame_nbyte != 0: raise IOError("Unexpected end of file") nframe_read += nbyte_read // frame_nbyte - while nbyte_read < buf.nbytes: + while nbyte_read < buf[0].nbytes: self.cur_file += 1 if self.cur_file == self.nfile: break @@ -121,18 +119,18 @@ def readinto(self, buf, frame_nbyte): return nframe_read class DeserializeBlock(SourceBlock): - def __init__(self, filenames, gulp_nframe, *args, **kwargs): + def __init__(self, filenames: List[str], gulp_nframe: int, *args, **kwargs): super(DeserializeBlock, self).__init__(filenames, gulp_nframe, *args, **kwargs) - def create_reader(self, sourcename): + def create_reader(self, sourcename: str) -> BifrostReader: return BifrostReader(sourcename) - def on_sequence(self, ireader, sourcename): - hdr = ireader.header + def on_sequence(self, ireader: BifrostReader, sourcename: str) -> List[Dict[str,Any]]: return [ireader.header] - def on_data(self, reader, ospans): + def on_data(self, reader: BifrostReader, ospans: List[WriteSpan]) -> List[int]: ospan = ospans[0] return [reader.readinto(ospan.data, ospan.frame_nbyte)] -def deserialize(filenames, gulp_nframe, *args, **kwargs): +def deserialize(filenames: List[str], gulp_nframe: int, + *args, **kwargs) -> DeserializeBlock: """Deserializes a data stream from a set of files using a simple data format Sequence headers are read as JSON files, and sequence data are read @@ -172,7 +170,7 @@ def deserialize(filenames, gulp_nframe, *args, **kwargs): # **TODO: Write a DeserializeBlock that does the inverse of this class SerializeBlock(SinkBlock): - def __init__(self, iring, path, max_file_size=None, *args, **kwargs): + def __init__(self, iring: Ring, path: str, max_file_size: Optional[int]=None, *args, **kwargs): super(SerializeBlock, self).__init__(iring, *args, **kwargs) if path is None: path = '' @@ -203,7 +201,7 @@ def _open_new_data_files(self, frame_offset): raise NotImplementedError("Multiple ringlet axes not supported") # Open data files self.ofiles = [open(fname, 'wb') for fname in filenames] - def on_sequence(self, iseq): + def on_sequence(self, iseq: ReadSequence) -> None: hdr = iseq.header tensor = hdr['_tensor'] if hdr['name'] != '': @@ -222,9 +220,9 @@ def on_sequence(self, iseq): self.frame_axis = shape.index(-1) self.nringlet = reduce(lambda a, b: a * b, shape[:self.frame_axis], 1) self._open_new_data_files(frame_offset=0) - def on_sequence_end(self, iseq): + def on_sequence_end(self, iseq: ReadSequence) -> None: self._close_data_files() - def on_data(self, ispan): + def on_data(self, ispan: ReadSpan) -> None: if self.nringlet == 1: bytes_to_write = ispan.data.nbytes else: @@ -240,7 +238,8 @@ def on_data(self, ispan): for r in range(self.nringlet): ispan.data[r].tofile(self.ofiles[r]) -def serialize(iring, path=None, max_file_size=None, *args, **kwargs): +def serialize(iring: Ring, path: str=None, max_file_size: Optional[int]=None, + *args, **kwargs) -> SerializeBlock: """Serializes a data stream to a set of files using a simple data format Sequence headers are written as JSON files, and sequence data are written diff --git a/python/bifrost/blocks/sigproc.py b/python/bifrost/blocks/sigproc.py index 397f1c2fb..ada18f7a4 100644 --- a/python/bifrost/blocks/sigproc.py +++ b/python/bifrost/blocks/sigproc.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,20 +25,17 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import, print_function -import sys -if sys.version_info < (3,): - range = xrange - from bifrost.pipeline import SourceBlock, SinkBlock import bifrost.sigproc2 as sigproc from bifrost.DataType import DataType from bifrost.units import convert_units +from bifrost.ring2 import Ring, ReadSequence, ReadSpan, WriteSpan from numpy import transpose import os +from typing import Any, Dict, List, Optional + from bifrost import telemetry telemetry.track_module() @@ -52,12 +49,12 @@ def _unix2mjd(unix): return unix / 86400. + 40587 class SigprocSourceBlock(SourceBlock): - def __init__(self, filenames, gulp_nframe, unpack=True, *args, **kwargs): + def __init__(self, filenames: List[str], gulp_nframe: int, unpack: bool=True, *args, **kwargs): super(SigprocSourceBlock, self).__init__(filenames, gulp_nframe, *args, **kwargs) self.unpack = unpack - def create_reader(self, sourcename): + def create_reader(self, sourcename: str) -> sigproc.SigprocFile: return sigproc.SigprocFile(sourcename) - def on_sequence(self, ireader, sourcename): + def on_sequence(self, ireader: sigproc.SigprocFile, sourcename: str) -> List[Dict[str,Any]]: ihdr = ireader.header assert(ihdr['data_type'] in [1, # filterbank 2, # (dedispersed) time series @@ -104,7 +101,7 @@ def on_sequence(self, ireader, sourcename): ohdr['time_tag'] = time_tag ohdr['name'] = sourcename return [ohdr] - def on_data(self, reader, ospans): + def on_data(self, reader: sigproc.SigprocFile, ospans: List[WriteSpan]) -> List[int]: ospan = ospans[0] #print("SigprocReadBlock::on_data", ospan.data.dtype) if self.unpack: @@ -133,7 +130,8 @@ def on_data(self, reader, ospans): nframe = nbyte // ospan.frame_nbyte return [nframe] -def read_sigproc(filenames, gulp_nframe, unpack=True, *args, **kwargs): +def read_sigproc(filenames: List[str], gulp_nframe: int, unpack: bool=True, + *args, **kwargs) -> SigprocSourceBlock: """Read SIGPROC data files. Capable of reading filterbank, time series, and dedispersed subband data. @@ -162,12 +160,12 @@ def _copy_item_if_exists(dst, src, key, newkey=None): dst[newkey] = src[key] class SigprocSinkBlock(SinkBlock): - def __init__(self, iring, path=None, *args, **kwargs): + def __init__(self, iring: Ring, path: Optional[str]=None, *args, **kwargs): super(SigprocSinkBlock, self).__init__(iring, *args, **kwargs) if path is None: path = '' self.path = path - def on_sequence(self, iseq): + def on_sequence(self, iseq: ReadSequence) -> None: ihdr = iseq.header itensor = ihdr['_tensor'] @@ -322,14 +320,14 @@ def on_sequence(self, iseq): " [time, pol]\n [dispersion, time, pol]\n" + " [pol, freq, phase]") - def on_sequence_end(self, iseq): + def on_sequence_end(self, iseq: ReadSequence) -> None: if hasattr(self, 'ofile'): self.ofile.close() elif hasattr(self, 'ofiles'): for ofile in self.ofiles: ofile.close() - def on_data(self, ispan): + def on_data(self, ispan: ReadSpan) -> None: idata = ispan.data if self.data_format == 'filterbank': if len(idata.shape) == 3: @@ -359,7 +357,8 @@ def on_data(self, ispan): else: raise ValueError("Internal error: Unknown data format!") -def write_sigproc(iring, path=None, *args, **kwargs): +def write_sigproc(iring: Ring, path: Optional[str]=None, + *args, **kwargs) -> SigprocSinkBlock: """Write data as Sigproc files. Args: diff --git a/python/bifrost/blocks/transpose.py b/python/bifrost/blocks/transpose.py index 1623cb69b..85b203290 100644 --- a/python/bifrost/blocks/transpose.py +++ b/python/bifrost/blocks/transpose.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,23 +25,25 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - +from bifrost.transpose import transpose as bf_transpose +from bifrost.memory import space_accessible from bifrost.pipeline import TransformBlock -import bifrost as bf +from bifrost.ring2 import Ring, ReadSequence, ReadSpan, WriteSpan from copy import deepcopy import numpy as np +from typing import Any, Dict, List, Tuple, Union + from bifrost import telemetry telemetry.track_module() class TransposeBlock(TransformBlock): - def __init__(self, iring, axes, *args, **kwargs): + def __init__(self, iring: Ring, axes: Union[List[int],Tuple[int]], *args, **kwargs): super(TransposeBlock, self).__init__(iring, *args, **kwargs) self.specified_axes = axes self.space = self.orings[0].space - def on_sequence(self, iseq): + def on_sequence(self, iseq: ReadSequence) -> Dict[str,Any]: ihdr = iseq.header itensor = ihdr['_tensor'] # TODO: Is this a good idea? @@ -70,14 +72,15 @@ def on_sequence(self, iseq): otensor[item] = [itensor[item][axis] for axis in self.axes] return ohdr - def on_data(self, ispan, ospan): + def on_data(self, ispan: ReadSpan, ospan: WriteSpan) -> None: # TODO: bf.memory.transpose should support system space too - if bf.memory.space_accessible(self.space, ['cuda']): - bf.transpose.transpose(ospan.data, ispan.data, self.axes) + if space_accessible(self.space, ['cuda']): + bf_transpose(ospan.data, ispan.data, self.axes) else: ospan.data[...] = np.transpose(ispan.data, self.axes) -def transpose(iring, axes, *args, **kwargs): +def transpose(iring: Ring, axes: Union[List[int],Tuple[int]], + *args, **kwargs) -> TransposeBlock: """Transpose (permute) axes of the data. Args: diff --git a/python/bifrost/blocks/unpack.py b/python/bifrost/blocks/unpack.py index fec94faed..2e3032cfb 100644 --- a/python/bifrost/blocks/unpack.py +++ b/python/bifrost/blocks/unpack.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,27 +25,29 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import - -import bifrost as bf +from bifrost.unpack import unpack as bf_unpack from bifrost.pipeline import TransformBlock from bifrost.DataType import DataType +from bifrost.ring2 import Ring, ReadSequence, ReadSpan, WriteSpan from copy import deepcopy +import numpy as np + +from typing import Any, Dict, Union, Tuple from bifrost import telemetry telemetry.track_module() class UnpackBlock(TransformBlock): - def __init__(self, iring, dtype, align_msb=False, + def __init__(self, iring: Ring, dtype: Union[str,np.dtype], align_msb: bool=False, *args, **kwargs): super(UnpackBlock, self).__init__(iring, *args, **kwargs) self.dtype = dtype self.align_msb = align_msb - def define_valid_input_spaces(self): + def define_valid_input_spaces(self) -> Tuple[str]: """Return set of valid spaces (or 'any') for each input""" - return ('system',) - def on_sequence(self, iseq): + return ('any',) + def on_sequence(self, iseq: ReadSequence) -> Dict[str,Any]: ihdr = iseq.header ohdr = deepcopy(ihdr) itype = DataType(ihdr['_tensor']['dtype']) @@ -58,12 +60,12 @@ def on_sequence(self, iseq): otype = self.dtype ohdr['_tensor']['dtype'] = otype return ohdr - def on_data(self, ispan, ospan): + def on_data(self, ispan: ReadSpan, ospan: WriteSpan) -> None: idata = ispan.data odata = ospan.data - bf.unpack.unpack(idata, odata, self.align_msb) + bf_unpack(idata, odata, self.align_msb) -def unpack(iring, dtype, *args, **kwargs): +def unpack(iring: Ring, dtype: Union[str,np.dtype], *args, **kwargs) -> UnpackBlock: """Unpack data to a larger data type. Args: @@ -74,8 +76,8 @@ def unpack(iring, dtype, *args, **kwargs): **Tensor semantics**:: - Input: [...], dtype = one of: i/u2, i/u4, ci2, ci4, space = SYSTEM - Output: [...], dtype = i8 or ci8 (matching input), space = SYSTEM + Input: [...], dtype = one of: i/u2, i/u4, ci2, ci4, space = SYSTEM or CUDA + Output: [...], dtype = i8 or ci8 (matching input), space = SYSTEM or CUDA Returns: UnpackBlock: A new block instance. diff --git a/python/bifrost/blocks/wav.py b/python/bifrost/blocks/wav.py index 7f6966fec..16e05cc67 100644 --- a/python/bifrost/blocks/wav.py +++ b/python/bifrost/blocks/wav.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,40 +25,26 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info < (3,): - range = xrange - from bifrost.pipeline import SourceBlock, SinkBlock from bifrost.DataType import DataType from bifrost.units import convert_units +from bifrost.ring2 import Ring, ReadSequence, ReadSpan, WriteSpan import struct import os +from typing import Any, Dict, IO, List, Optional, Tuple + from bifrost import telemetry telemetry.track_module() -def wav_read_chunk_desc(f): +def wav_read_chunk_desc(f: IO[bytes]) -> Tuple[str,int,str]: id_, size, fmt = struct.unpack('<4sI4s', f.read(12)) - try: - id_ = id_.decode() - fmt = fmt.decode() - except AttributeError: - # Catch for Python2 - pass - return id_, size, fmt -def wav_read_subchunk_desc(f): + return id_.decode(), size, fmt.decode() +def wav_read_subchunk_desc(f: IO[bytes]) -> Tuple[str,int]: id_, size = struct.unpack('<4sI', f.read(8)) - try: - id_ = id_.decode() - except AttributeError: - # Catch for Python2 - pass - return id_, size -def wav_read_subchunk_fmt(f, size): + return id_.decode(), size +def wav_read_subchunk_fmt(f: IO[bytes], size: int) -> Dict[str,int]: assert(size >= 16) packed = f.read(16) f.seek(size - 16, 1) @@ -67,7 +53,7 @@ def wav_read_subchunk_fmt(f, size): vals = struct.unpack(' Tuple[Dict[str,int],int]: # **TODO: Some files actually have extra subchunks _after_ the data as well # This is rather annoying :/ chunk_id, chunk_size, chunk_fmt = wav_read_chunk_desc(f) @@ -83,7 +69,7 @@ def wav_read_header(f): subchunk_id, subchunk_size = wav_read_subchunk_desc(f) data_size = subchunk_size return hdr, data_size -def wav_write_header(f, hdr, chunk_size=0, data_size=0): +def wav_write_header(f: IO[bytes], hdr:Dict[str,int], chunk_size: int=0, data_size: int=0) -> None: # Note: chunk_size = file size - 8 f.write(struct.pack('<4sI4s4sIHHIIHH4sI', 'RIFF', chunk_size, 'WAVE', @@ -93,9 +79,9 @@ def wav_write_header(f, hdr, chunk_size=0, data_size=0): 'data', data_size)) class WavSourceBlock(SourceBlock): - def create_reader(self, sourcename): + def create_reader(self, sourcename: str) -> IO[bytes]: return open(sourcename, 'rb') - def on_sequence(self, reader, sourcename): + def on_sequence(self, reader: IO[bytes], sourcename: str) -> List[Dict[str,Any]]: hdr, self.bytes_remaining = wav_read_header(reader) ohdr = { '_tensor': { @@ -111,7 +97,7 @@ def on_sequence(self, reader, sourcename): } return [ohdr] - def on_data(self, reader, ospans): + def on_data(self, reader: IO[bytes], ospans: List[WriteSpan]) -> List[int]: ospan = ospans[0] nbyte = reader.readinto(ospan.data) if nbyte % ospan.frame_nbyte: @@ -126,7 +112,8 @@ def on_data(self, reader, ospans): nframe = nbyte // ospan.frame_nbyte return [nframe] -def read_wav(sourcefiles, gulp_nframe, *args, **kwargs): +def read_wav(sourcefiles: List[str], gulp_nframe: int, + *args, **kwargs) -> WavSourceBlock: """Read Wave files (.wav). Args: @@ -146,12 +133,12 @@ def read_wav(sourcefiles, gulp_nframe, *args, **kwargs): return WavSourceBlock(sourcefiles, gulp_nframe, *args, **kwargs) class WavSinkBlock(SinkBlock): - def __init__(self, iring, path=None, *args, **kwargs): + def __init__(self, iring: Ring, path: Optional[str]=None, *args, **kwargs): super(WavSinkBlock, self).__init__(iring, *args, **kwargs) if path is None: path = '' self.path = path - def on_sequence(self, iseq): + def on_sequence(self, iseq: ReadSequence) -> None: ihdr = iseq.header itensor = ihdr['_tensor'] @@ -188,14 +175,14 @@ def on_sequence(self, iseq): else: raise ValueError("Incompatible axes: " + str(axnames)) - def on_sequence_end(self, iseq): + def on_sequence_end(self, iseq: ReadSequence) -> None: if hasattr(self, 'ofile'): self.ofile.close() elif hasattr(self, 'ofiles'): for ofile in self.ofiles: ofile.close() - def on_data(self, ispan): + def on_data(self, ispan: ReadSpan) -> None: idata = ispan.data if idata.ndim == 2: idata.tofile(self.ofile) @@ -205,7 +192,8 @@ def on_data(self, ispan): else: raise ValueError("Internal error: Unknown data format!") -def write_wav(iring, path=None, *args, **kwargs): +def write_wav(iring: Ring, path: Optional[str]=None, + *args, **kwargs) -> WavSinkBlock: """Write data as Wave files (.wav). Args: diff --git a/python/bifrost/core.py b/python/bifrost/core.py index 8da672d3c..40e233a6e 100644 --- a/python/bifrost/core.py +++ b/python/bifrost/core.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,17 +26,14 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - -from bifrost.libbifrost import _bf +from bifrost.libbifrost import _bf, _th from bifrost import telemetry telemetry.track_module() -def status_string(status): - return _bf.bfGetStatusString(status) -def debug_enabled(): +def status_string(status: _th.BFstatus_enum) -> str: + return _bf.bfGetStatusString(status.value) +def debug_enabled() -> bool: return bool(_bf.bfGetDebugEnabled()) -def cuda_enabled(): +def cuda_enabled() -> bool: return bool(_bf.bfGetCudaEnabled()) diff --git a/python/bifrost/device.py b/python/bifrost/device.py index 1fb044964..26495b758 100644 --- a/python/bifrost/device.py +++ b/python/bifrost/device.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,28 +25,68 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - +from ctypes import c_ulong, pointer as c_pointer from bifrost.libbifrost import _bf, _check, _get +from typing import Union from bifrost import telemetry telemetry.track_module() -def set_device(device): +def set_device(device: Union[int,str]) -> None: if isinstance(device, int): _check(_bf.bfDeviceSet(device)) else: - _check(_bf.bfDeviceSetById(device)) -def get_device(): + _check(_bf.bfDeviceSetById(device.encode())) + +def get_device() -> int: return _get(_bf.bfDeviceGet) -# TODO: set/get_stream +def set_stream(stream: int) -> bool: + """Set the CUDA stream to the provided stream handle""" + stream = c_ulong(stream) + _check(_bf.bfStreamSet(c_pointer(stream))) + return True + +def get_stream() -> int: + """Get the current CUDA stream and return its address""" + stream = c_ulong(0) + _check(_bf.bfStreamGet(c_pointer(stream))) + return stream.value + +class ExternalStream(object): + """Context manager to use a stream created outside Bifrost""" + def __init__(self, stream): + self._stream = stream + def __del__(self): + try: + set_stream(self._orig_stream) + except AttributeError: + pass + def use(self): + """Make the external stream the default stream. The original Bifrost + stream will be restored when this object is deleted. + + To temporirly switch streams use the 'with' statement.""" + self._orig_stream = get_stream() + # cupy stream? + stream = getattr(self._stream, 'ptr', None) + if stream is None: + # pycuda stream? + stream = getattr(self._stream, 'handle', None) + if stream is None: + stream = self._stream + set_stream(stream) + def __enter__(self): + self.use() + return self + def __exit__(self, type, value, tb): + set_stream(self._orig_stream) + del self._orig_stream -def stream_synchronize(): +def stream_synchronize() -> None: _check(_bf.bfStreamSynchronize()) -def set_devices_no_spin_cpu(): +def set_devices_no_spin_cpu() -> None: """Sets a flag on all GPU devices that tells them not to spin the CPU when synchronizing. This is useful for reducing CPU load in GPU pipelines. diff --git a/python/bifrost/dtype.py b/python/bifrost/dtype.py deleted file mode 100644 index 2dd3363a6..000000000 --- a/python/bifrost/dtype.py +++ /dev/null @@ -1,148 +0,0 @@ - -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Bifrost Authors nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -""" - -i: signed integer -u: unsigned integer -f: floating point -ci: complex signed integer -cu: complex unsigned integer -cf: complex floating pointer - -i4: 4-bit signed integer -f16: 16-bit floating point -ci4: 4+4-bit complex signed integer -cf32: 32+32-bit complex floating point - -""" - -# Python2 compatibility -from __future__ import absolute_import - -from bifrost.libbifrost import _bf -import numpy as np - -from bifrost import telemetry -telemetry.track_module() - -def split_name_nbit(dtype_str): - """Splits a dtype string into (name, nbit)""" - for i, char in enumerate(dtype_str): - if char.isdigit(): - break - name = dtype_str[:i] - nbit = int(dtype_str[i:]) - return name, nbit - -# Custom dtypes to represent additional complex types -ci8 = np.dtype([('re', np.int8), ('im', np.int8)]) -ci16 = np.dtype([('re', np.int16), ('im', np.int16)]) -ci32 = np.dtype([('re', np.int32), ('im', np.int32)]) -cf16 = np.dtype([('re', np.float16), ('im', np.float16)]) -def to_complex64(q): - real_type = q.dtype['re'] - return q.view(real_type).astype(np.float32).view(np.complex64) -def from_complex64(f, dtype): - real_type = dtype['re'] - return f.view(np.float32).astype(real_type).view(dtype) - -def numpy2bifrost(dtype): - if dtype == np.int8: return _bf.BF_DTYPE_I8 - elif dtype == np.int16: return _bf.BF_DTYPE_I16 - elif dtype == np.int32: return _bf.BF_DTYPE_I32 - elif dtype == np.uint8: return _bf.BF_DTYPE_U8 - elif dtype == np.uint16: return _bf.BF_DTYPE_U16 - elif dtype == np.uint32: return _bf.BF_DTYPE_U32 - elif dtype == np.float16: return _bf.BF_DTYPE_F16 - elif dtype == np.float32: return _bf.BF_DTYPE_F32 - elif dtype == np.float64: return _bf.BF_DTYPE_F64 - elif dtype == np.float128: return _bf.BF_DTYPE_F128 - elif dtype == ci8: return _bf.BF_DTYPE_CI8 - elif dtype == ci16: return _bf.BF_DTYPE_CI16 - elif dtype == ci32: return _bf.BF_DTYPE_CI32 - elif dtype == cf16: return _bf.BF_DTYPE_CF16 - elif dtype == np.complex64: return _bf.BF_DTYPE_CF32 - elif dtype == np.complex128: return _bf.BF_DTYPE_CF64 - elif dtype == np.complex256: return _bf.BF_DTYPE_CF128 - else: raise ValueError("Unsupported dtype: " + str(dtype)) - -def name_nbit2numpy(name, nbit): - if name == 'i': - if nbit == 8: return np.int8 - elif nbit == 16: return np.int16 - elif nbit == 32: return np.int32 - elif nbit == 64: return np.int64 - else: raise TypeError("Invalid signed integer type size: %i" % nbit) - elif name == 'u': - if nbit == 8: return np.uint8 - elif nbit == 16: return np.uint16 - elif nbit == 32: return np.uint32 - elif nbit == 64: return np.uint64 - else: raise TypeError("Invalid unsigned integer type size: %i" % nbit) - elif name == 'f': - if nbit == 16: return np.float16 - elif nbit == 32: return np.float32 - elif nbit == 64: return np.float64 - elif nbit == 128: return np.float128 - else: raise TypeError("Invalid floating-point type size: %i" % nbit) - elif name == 'ci': - if nbit == 8: return ci8 - elif nbit == 16: return ci16 - elif nbit == 32: return ci32 - # elif name in set(['ci', 'cu']): - # Note: This gives integer types in place of proper complex types - # return name_nbit2numpy(name[1:], nbit*2) - elif name == 'cf': - if nbit == 16: return cf16 - elif nbit == 32: return np.complex64 - elif nbit == 64: return np.complex128 - elif nbit == 128: return np.complex256 - else: raise TypeError("Invalid complex floating-point type size: %i" % - nbit) - else: - raise TypeError("Invalid type name: " + name) -def string2numpy(dtype_str): - return name_nbit2numpy(*split_name_nbit(dtype_str)) - -def numpy2string(dtype): - if dtype == np.int8: return 'i8' - elif dtype == np.int16: return 'i16' - elif dtype == np.int32: return 'i32' - elif dtype == np.int64: return 'i64' - elif dtype == np.uint8: return 'u8' - elif dtype == np.uint16: return 'u16' - elif dtype == np.uint32: return 'u32' - elif dtype == np.uint64: return 'u64' - elif dtype == np.float16: return 'f16' - elif dtype == np.float32: return 'f32' - elif dtype == np.float64: return 'f64' - elif dtype == np.float128: return 'f128' - elif dtype == np.complex64: return 'cf32' - elif dtype == np.complex128: return 'cf64' - elif dtype == np.complex256: return 'cf128' - else: raise TypeError("Unsupported dtype: " + str(dtype)) diff --git a/python/bifrost/fdmt.py b/python/bifrost/fdmt.py index 9a902ce09..22050eedb 100644 --- a/python/bifrost/fdmt.py +++ b/python/bifrost/fdmt.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,11 +25,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - -from bifrost.libbifrost import _bf, _check, _get, BifrostObject, _string2space +from bifrost.libbifrost import _bf, _th, _check, _get, BifrostObject from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray +from bifrost.Space import Space + +from typing import Union from bifrost import telemetry telemetry.track_module() @@ -37,12 +38,13 @@ class Fdmt(BifrostObject): def __init__(self): BifrostObject.__init__(self, _bf.bfFdmtCreate, _bf.bfFdmtDestroy) - def init(self, nchan, max_delay, f0, df, exponent=-2.0, space='cuda'): - space = _string2space(space) + def init(self, nchan: int, max_delay: int, f0: float, df: float, + exponent: float=-2.0, space: Union[str,_th.BFspace_enum,_bf.BFspace]='cuda'): + space = Space(space) psize = None _check(_bf.bfFdmtInit(self.obj, nchan, max_delay, f0, df, - exponent, space, 0, psize)) - def execute(self, idata, odata, negative_delays=False): + exponent, space.as_BFspace(), 0, psize)) + def execute(self, idata: ndarray, odata: ndarray, negative_delays: bool=False) -> ndarray: # TODO: Work out how to integrate CUDA stream psize = None _check( _bf.bfFdmtExecute( @@ -53,15 +55,16 @@ def execute(self, idata, odata, negative_delays=False): None, psize) ) return odata - def get_workspace_size(self, idata, odata): + def get_workspace_size(self, idata: ndarray, odata: ndarray) -> int: return _get(_bf.bfFdmtExecute, self.obj, asarray(idata).as_BFarray(), asarray(odata).as_BFarray(), False, None) - def execute_workspace(self, idata, odata, workspace_ptr, workspace_size, - negative_delays=False): + def execute_workspace(self, idata: ndarray, odata: ndarray, + workspace_ptr: int, workspace_size: int, + negative_delays: bool=False) -> ndarray: size = _bf.BFsize(workspace_size) _check(_bf.bfFdmtExecute( self.obj, diff --git a/python/bifrost/fft.py b/python/bifrost/fft.py index 67777f2fa..fa1813ad2 100644 --- a/python/bifrost/fft.py +++ b/python/bifrost/fft.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,20 +25,22 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - -from bifrost.libbifrost import _bf, _check, _get, BifrostObject +from bifrost.libbifrost import _bf, _th, _check, _get, BifrostObject from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray import ctypes +from typing import List, Optional, Tuple, Union + from bifrost import telemetry telemetry.track_module() class Fft(BifrostObject): def __init__(self): BifrostObject.__init__(self, _bf.bfFftCreate, _bf.bfFftDestroy) - def init(self, iarray, oarray, axes=None, apply_fftshift=False): + def init(self, iarray: ndarray, oarray: ndarray, + axes: Optional[Union[int,List[int],Tuple[int]]]=None, + apply_fftshift: bool=False): if isinstance(axes, int): axes = [axes] ndim = len(axes) @@ -52,12 +54,13 @@ def init(self, iarray, oarray, axes=None, apply_fftshift=False): ndim, axes, apply_fftshift) - def execute(self, iarray, oarray, inverse=False): + def execute(self, iarray: ndarray, oarray: ndarray, inverse: bool=False) -> ndarray: return self.execute_workspace(iarray, oarray, workspace_ptr=None, workspace_size=0, inverse=inverse) - def execute_workspace(self, iarray, oarray, workspace_ptr, workspace_size, - inverse=False): + def execute_workspace(self, iarray: ndarray, oarray: ndarray, + workspace_ptr: int, workspace_size: int, + inverse: bool=False) -> ndarray: _check(_bf.bfFftExecute( self.obj, asarray(iarray).as_BFarray(), diff --git a/python/bifrost/fir.py b/python/bifrost/fir.py index e7873c4ba..c728d32b0 100644 --- a/python/bifrost/fir.py +++ b/python/bifrost/fir.py @@ -1,6 +1,6 @@ -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,11 +26,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - -from bifrost.libbifrost import _bf, _check, BifrostObject, _string2space +from bifrost.libbifrost import _bf, _th, _check, BifrostObject, _string2space from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray +from bifrost.Space import Space + +from typing import Union from bifrost import telemetry telemetry.track_module() @@ -38,16 +39,17 @@ class Fir(BifrostObject): def __init__(self): BifrostObject.__init__(self, _bf.bfFirCreate, _bf.bfFirDestroy) - def init(self, coeffs, decim=1, space='cuda'): - space = _string2space(space) + def init(self, coeffs: ndarray, decim: int=1, + space: Union[str,_th.BFspace_enum,_bf.BFspace]='cuda'): + space = Space(space) psize = None - _check( _bf.bfFirInit(self.obj, asarray(coeffs).as_BFarray(), decim, space, 0, psize) ) - def set_coeffs(self, coeffs): + _check( _bf.bfFirInit(self.obj, asarray(coeffs).as_BFarray(), decim, space.as_BFspace(), 0, psize) ) + def set_coeffs(self, coeffs: ndarray) -> None: _check( _bf.bfFirSetCoeffs(self.obj, asarray(coeffs).as_BFarray()) ) - def reset_state(self): + def reset_state(self) -> None: _check( _bf.bfFirResetState(self.obj) ) - def execute(self, idata, odata): + def execute(self, idata: ndarray, odata: ndarray) -> ndarray: # TODO: Work out how to integrate CUDA stream _check( _bf.bfFirExecute(self.obj, asarray(idata).as_BFarray(), diff --git a/python/bifrost/guppi_raw.py b/python/bifrost/guppi_raw.py index 9e9341f84..dbb20ad3a 100644 --- a/python/bifrost/guppi_raw.py +++ b/python/bifrost/guppi_raw.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -54,13 +54,12 @@ """ -# Python2 compatibility -from __future__ import division +from typing import Any, Dict, IO from bifrost import telemetry telemetry.track_module() -def read_header(f): +def read_header(f: IO[str]) -> Dict[str,Any]: RECORD_LEN = 80 DIRECTIO_ALIGN_NBYTE = 512 buf = bytearray(RECORD_LEN) @@ -70,12 +69,8 @@ def read_header(f): if len(record) < RECORD_LEN: raise IOError("EOF reached in middle of header") - try: - record = record.decode() - except AttributeError: - # Python2 catch - pass - if record.startswith(b'END'): + record = record.decode() + if record.startswith('END'): break key, val = record.split('=', 1) key, val = key.strip(), val.strip() diff --git a/python/bifrost/header_standard.py b/python/bifrost/header_standard.py index 29c995698..83baed275 100644 --- a/python/bifrost/header_standard.py +++ b/python/bifrost/header_standard.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -43,6 +43,10 @@ """ +import numpy as np + +from typing import Dict, Any + from bifrost import telemetry telemetry.track_module() @@ -51,15 +55,15 @@ # Format: # 'parameter name':(type, minimum) STANDARD_HEADER = { - 'nchans': (int, 1), - 'nifs': (int, 1, ), - 'nbits': (int, 1), - 'fch1': (float, 0), - 'foff': (float, None), - 'tstart': (float, 0), - 'tsamp': (float, 0)} + 'nchans': ((int, np.int64), 1), + 'nifs': ((int, np.int64), 1), + 'nbits': ((int, np.int64), 1), + 'fch1': ((float, np.float64), 0), + 'foff': ((float, np.float64), None), + 'tstart': ((float, np.float64), 0), + 'tsamp': ((float, np.float64), 0)} -def enforce_header_standard(header_dict): +def enforce_header_standard(header_dict: Dict[str,Any]) -> bool: """Raise an error if the header dictionary passed does not fit the standard specified above.""" if type(header_dict) != dict: @@ -67,7 +71,7 @@ def enforce_header_standard(header_dict): for parameter, standard in STANDARD_HEADER.items(): if parameter not in header_dict: return False - if type(header_dict[parameter]) != standard[0]: + if not isinstance(header_dict[parameter], standard[0]): return False if standard[1] is not None and \ header_dict[parameter] < standard[1]: diff --git a/python/bifrost/libbifrost.py b/python/bifrost/libbifrost.py index e806cbc47..5f1717fc7 100644 --- a/python/bifrost/libbifrost.py +++ b/python/bifrost/libbifrost.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,21 +34,32 @@ # instance instead of LP_s # E.g., _bf.bfRingSequenceGetName() [should be ] -# Python2 compatibility -from __future__ import absolute_import - import ctypes import bifrost.libbifrost_generated as _bf +import bifrost.libbifrost_typehints as _th bf = _bf # Public access to library +th = _th # Public access to type hints + +from typing import Any, Callable from bifrost import telemetry telemetry.track_module() # Internal helpers below +class EndOfDataStop(RuntimeError): + """This class is used as a Py3 StopIterator + + In Python >3.7, reaching a StopIterator in a generator will + raise a RuntimeError (so you can't do 'except StopIteration' to catch it!) + See PEP479 https://www.python.org/dev/peps/pep-0479/ + """ + pass + class BifrostObject(object): """Base class for simple objects with create/destroy functions""" - def __init__(self, constructor, destructor, *args): + def __init__(self, constructor: Callable, destructor: Callable, *args: Any): + self._obj_basename = constructor.__name__.replace('Create','') self.obj = destructor.argtypes[0]() _check(constructor(ctypes.byref(self.obj), *args)) self._destructor = destructor @@ -62,6 +73,22 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self._destroy() + def set_stream(self, stream: int): + set_fnc = getattr(_bf, self._obj_basename+"SetStream", None) + if set_fnc is None: + raise AttributeError("set_stream() is not supported by %s objects" % self._obj_basename) + + _check( set_fnc(self.obj, + ctypes.pointer(stream)) ) + def get_stream(self) -> int: + get_fnc = getattr(_bf, self._obj_basename+"GetStream", None) + if get_fnc is None: + raise AttributeError("get_stream() is not supported by %s objects" % self._obj_basename) + + stream = ctypes.c_ulong(0) + _check( get_fnc(self.obj, + ctypes.pointer(stream))) + return stream.value def _array(size_or_vals, dtype=None): if size_or_vals is None: @@ -84,11 +111,7 @@ def _array(size_or_vals, dtype=None): elif isinstance(vals[0], float): dtype = ctypes.c_double elif isinstance(vals[0], str): - try: - vals = [val.encode() for val in vals] - except AttributeError: - # Python2 catch - pass + vals = [val.encode() for val in vals] dtype = ctypes.c_char_p elif isinstance(vals[0], _bf.BFarray): dtype = ctypes.POINTER(_bf.BFarray) @@ -99,13 +122,13 @@ def _array(size_or_vals, dtype=None): raise TypeError("Cannot deduce C type from ", type(vals[0])) return (dtype * len(vals))(*vals) -def _check(status): +def _check(status: _bf.BFstatus) -> _th.BFstatus_enum: if __debug__: if status != _bf.BF_STATUS_SUCCESS: if status is None: raise RuntimeError("WTF, status is None") if status == _bf.BF_STATUS_END_OF_DATA: - raise StopIteration() + raise EndOfDataStop('BF_STATUS_END_OF_DATA') elif status == _bf.BF_STATUS_WOULD_BLOCK: raise IOError('BF_STATUS_WOULD_BLOCK') else: @@ -113,10 +136,10 @@ def _check(status): raise RuntimeError(status_str) else: if status == _bf.BF_STATUS_END_OF_DATA: - raise StopIteration() + raise EndOfDataStop('BF_STATUS_END_OF_DATA') elif status == _bf.BF_STATUS_WOULD_BLOCK: raise IOError('BF_STATUS_WOULD_BLOCK') - return status + return _th.BFstatus_enum(status) DEREF = {ctypes.POINTER(t): t for t in [ctypes.c_bool, ctypes.c_char, @@ -145,7 +168,7 @@ def _check(status): ctypes.c_void_p, ctypes.c_wchar, ctypes.c_wchar_p]} -def _get(func, *args): +def _get(func: Callable, *args: Any) -> Any: retarg = -1 dtype = DEREF[func.argtypes[retarg]] ret = dtype() @@ -153,21 +176,14 @@ def _get(func, *args): _check(func(*args)) return ret.value -STRING2SPACE = {'auto': _bf.BF_SPACE_AUTO, - 'system': _bf.BF_SPACE_SYSTEM, - 'cuda': _bf.BF_SPACE_CUDA, - 'cuda_host': _bf.BF_SPACE_CUDA_HOST, - 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED} -def _string2space(s): - if s not in STRING2SPACE: +def _string2space(s: str) -> _bf.BFspace: + try: + space = getattr(_th.BFspace_enum, s) + except AttributeError: raise KeyError("Invalid space '" + str(s) + - "'.\nValid spaces: " + str(list(LUT.keys()))) - return STRING2SPACE[s] + "'.\nValid spaces: " + str(list(_th.BFspace_enum))) + return _bf.BFspace(space.value) -SPACE2STRING = {_bf.BF_SPACE_AUTO: 'auto', - _bf.BF_SPACE_SYSTEM: 'system', - _bf.BF_SPACE_CUDA: 'cuda', - _bf.BF_SPACE_CUDA_HOST: 'cuda_host', - _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed'} -def _space2string(i): - return SPACE2STRING[i] +def _space2string(i: _bf.BFspace) -> str: + name = _th.BFspace_enum(i).name + return name.replace('BF_SPACE_', '').lower() diff --git a/python/bifrost/linalg.py b/python/bifrost/linalg.py index e8029349f..3c7ffc40d 100644 --- a/python/bifrost/linalg.py +++ b/python/bifrost/linalg.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,11 +25,11 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check, BifrostObject from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray + +from typing import Optional from bifrost import telemetry telemetry.track_module() @@ -37,7 +37,7 @@ class LinAlg(BifrostObject): def __init__(self): BifrostObject.__init__(self, _bf.bfLinAlgCreate, _bf.bfLinAlgDestroy) - def matmul(self, alpha, a, b, beta, c): + def matmul(self, alpha: float, a: Optional[ndarray], b: Optional[ndarray], beta: float, c: ndarray) -> ndarray: """Computes: c = alpha*a.b + beta*c or if b is None: diff --git a/python/bifrost/map.py b/python/bifrost/map.py index c0ba2bf4e..8f3988f71 100644 --- a/python/bifrost/map.py +++ b/python/bifrost/map.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,27 +25,26 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import -import sys -if sys.version_info > (3,): - long = int - from bifrost.libbifrost import _bf, _check, _array from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray import numpy as np import ctypes +import glob +import os +from typing import Any, Dict, List, Optional +from bifrost.libbifrost_generated import BF_MAP_KERNEL_DISK_CACHE from bifrost import telemetry telemetry.track_module() -def _is_literal(x): - return isinstance(x, (int, long, float, complex)) +def _is_literal(x: Any) -> bool: + return isinstance(x, (int, float, complex)) -def _convert_to_array(arg): +def _convert_to_array(arg: Any) -> ndarray: if _is_literal(arg): arr = np.array(arg) - if isinstance(arg, (int, long)) and -(1 << 31) <= arg < (1 << 31): + if isinstance(arg, int) and -(1 << 31) <= arg < (1 << 31): arr = arr.astype(np.int32) # TODO: Any way to decide when these should be double-precision? elif isinstance(arg, float): @@ -56,9 +55,13 @@ def _convert_to_array(arg): arg = arr return asarray(arg) -def map(func_string, data, axis_names=None, shape=None, - func_name=None, extra_code=None, - block_shape=None, block_axes=None): +def map(func_string: str, data: Dict[str,Any], + axis_names: Optional[List[str]]=None, + shape: Optional[List[int]]=None, + func_name: Optional[str]=None, + extra_code: Optional[str]=None, + block_shape: Optional[List[int]]=None, + block_axes: Optional[List[int]]=None) -> ndarray: """Apply a function to a set of ndarrays. Args: @@ -107,15 +110,11 @@ def map(func_string, data, axis_names=None, shape=None, # Slice an array with a scalar index bf.map("c(i) = a(i,k)", {'c': c, 'a': a, 'k': 7}, ['i'], shape=c.shape) """ - try: - func_string = func_string.encode() - if func_name is not None: - func_name = func_name.encode() - if extra_code is not None: - extra_code = extra_code.encode() - except AttributeError: - # Python2 catch - pass + func_string = func_string.encode() + if func_name is not None: + func_name = func_name.encode() + if extra_code is not None: + extra_code = extra_code.encode() narg = len(data) ndim = len(shape) if shape is not None else 0 arg_arrays = [] @@ -142,3 +141,32 @@ def map(func_string, data, axis_names=None, shape=None, narg, _array(args), _array(arg_names), func_name, func_string, extra_code, _array(block_shape), _array(block_axes))) + +def list_map_cache() -> None: + output = "Cache enabled: %s" % ('yes' if BF_MAP_KERNEL_DISK_CACHE else 'no') + if BF_MAP_KERNEL_DISK_CACHE: + cache_path = os.path.join(os.path.expanduser('~'), '.bifrost', + _bf.BF_MAP_KERNEL_DISK_CACHE_SUBDIR) + try: + with open(os.path.join(cache_path, _bf.BF_MAP_KERNEL_DISK_CACHE_VERSION_FILE), 'r') as fh: + version = fh.read() + mapcache, runtime, driver = version.split(None, 2) + mapcache = int(mapcache, 10) + mapcache = f"{mapcache//1000}.{(mapcache//10) % 1000}" + runtime = int(runtime, 10) + runtime = f"{runtime//1000}.{(runtime//10) % 1000}" + driver = int(driver, 10) + driver = f"{driver//1000}.{(driver//10) % 1000}" + + entries = glob.glob(os.path.join(cache_path, '*.inf')) + + output += f"\nCache version: {mapcache} (map cache) {runtime} (runtime), {driver} (driver)" + output += f"\nCache entries: {len(entries)}" + except OSError: + pass + + print(output) + + +def clear_map_cache() -> None: + _check(_bf.bfMapClearCache()) diff --git a/python/bifrost/memory.py b/python/bifrost/memory.py index dc884e00b..5d89d8c9b 100644 --- a/python/bifrost/memory.py +++ b/python/bifrost/memory.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,16 +26,15 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check, _get, _string2space import ctypes +from typing import Any, List + from bifrost import telemetry telemetry.track_module() -def space_accessible(space, from_spaces): +def space_accessible(space: str, from_spaces: List[str]) -> bool: if from_spaces == 'any': # TODO: This is a little bit hacky return True from_spaces = set(from_spaces) @@ -48,27 +47,27 @@ def space_accessible(space, from_spaces): else: return False -def raw_malloc(size, space): +def raw_malloc(size: int, space: str) -> int: ptr = ctypes.c_void_p() _check(_bf.bfMalloc(ptr, size, _string2space(space))) return ptr.value -def raw_free(ptr, space='auto'): +def raw_free(ptr: int, space: str='auto') -> int: _check(_bf.bfFree(ptr, _string2space(space))) -def raw_get_space(ptr): +def raw_get_space(ptr: int) -> _bf.BFspace: return _get(_bf.bfGetSpace, ptr) -def alignment(): +def alignment() -> int: ret, _ = _bf.bfGetAlignment() return ret # **TODO: Deprecate below here! -def _get_space(arr): +def _get_space(arr: Any) -> str: try: return arr.flags['SPACE'] except KeyError: return 'system' # TODO: Dangerous to assume? # Note: These functions operate on numpy or GPU arrays -def memcpy(dst, src): +def memcpy(dst: int, src: int) -> None: assert(dst.flags['C_CONTIGUOUS']) assert(src.shape == dst.shape) dst_space = _string2space(_get_space(dst)) @@ -78,7 +77,7 @@ def memcpy(dst, src): src.ctypes.data, src_space, count)) return dst -def memcpy2D(dst, src): +def memcpy2D(dst: int, src: int) -> None: assert(len(dst.shape) == 2) assert(src.shape == dst.shape) dst_space = _string2space(_get_space(dst)) @@ -88,12 +87,12 @@ def memcpy2D(dst, src): _check(_bf.bfMemcpy2D(dst.ctypes.data, dst.strides[0], dst_space, src.ctypes.data, src.strides[0], src_space, width_bytes, height)) -def memset(dst, val=0): +def memset(dst: int, val: int=0) -> None: assert(dst.flags['C_CONTIGUOUS']) space = _string2space(_get_space(dst)) count = dst.nbytes _check(_bf.bfMemset(dst.ctypes.data, space, val, count)) -def memset2D(dst, val=0): +def memset2D(dst: int, val: int=0) -> None: assert(len(dst.shape) == 2) space = _string2space(_get_space(dst)) height, width = dst.shape diff --git a/python/bifrost/ndarray.py b/python/bifrost/ndarray.py index 27006114d..1b43d5ac3 100644 --- a/python/bifrost/ndarray.py +++ b/python/bifrost/ndarray.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2024, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -36,20 +36,15 @@ """ -# Python2 compatibility -from __future__ import absolute_import import sys -if sys.version_info < (3,): - range = xrange - import ctypes import numpy as np from bifrost.memory import raw_malloc, raw_free, raw_get_space, space_accessible -from bifrost.libbifrost import _bf, _check +from bifrost.libbifrost import _bf, _th, _check, _array, _space2string from bifrost import device from bifrost.DataType import DataType from bifrost.Space import Space -import sys +from bifrost.libbifrost_generated import struct_BFarray_ from bifrost import telemetry telemetry.track_module() @@ -69,16 +64,11 @@ def _address_as_buffer(address, nbyte, readonly=False): # Note: This works as a buffer in regular python and pypy # Note: int_asbuffer is undocumented; see here: # https://mail.scipy.org/pipermail/numpy-discussion/2008-January/030938.html - try: - int_asbuffer = ctypes.pythonapi.PyMemoryView_FromMemory - int_asbuffer.restype = ctypes.py_object - int_asbuffer.argtypes = (ctypes.c_void_p, ctypes.c_ssize_t, ctypes.c_int) - return int_asbuffer(address, nbyte, 0x100 if readonly else 0x200) - except AttributeError: - # Python2 catch - return np.core.multiarray.int_asbuffer( - address, nbyte, readonly=readonly, check=False) - + int_asbuffer = ctypes.pythonapi.PyMemoryView_FromMemory + int_asbuffer.restype = ctypes.py_object + int_asbuffer.argtypes = (ctypes.c_void_p, ctypes.c_ssize_t, ctypes.c_int) + return int_asbuffer(address, nbyte, 0x100 if readonly else 0x200) + def asarray(arr, space=None): if isinstance(arr, ndarray) and (space is None or space == arr.bf.space): return arr @@ -108,6 +98,10 @@ def copy_array(dst, src): src_bf = asarray(src) if (space_accessible(dst_bf.bf.space, ['system']) and space_accessible(src_bf.bf.space, ['system'])): + if (src_bf.bf.space == 'cuda_managed' or + dst_bf.bf.space == 'cuda_managed'): + # TODO: Decide where/when these need to be called + device.stream_synchronize() np.copyto(dst_bf, src_bf) else: _check(_bf.bfArrayCopy(dst_bf.as_BFarray(), @@ -150,6 +144,16 @@ def __new__(cls, base=None, space=None, shape=None, dtype=None, native is not None): raise ValueError('Invalid combination of arguments when base ' 'is specified') + if 'cupy' in sys.modules: + from cupy import ndarray as cupy_ndarray + if isinstance(base, cupy_ndarray): + return ndarray.__new__(cls, + space='cuda', + buffer=int(base.data), + shape=base.shape, + dtype=base.dtype, + strides=base.strides, + native=np.dtype(base.dtype).isnative) if 'pycuda' in sys.modules: from pycuda.gpuarray import GPUArray as pycuda_GPUArray if isinstance(base, pycuda_GPUArray): @@ -160,6 +164,22 @@ def __new__(cls, base=None, space=None, shape=None, dtype=None, dtype=base.dtype, strides=base.strides, native=np.dtype(base.dtype).isnative) + # Check if a BFarray ctypes struct is passed + if isinstance(base, struct_BFarray_): + ndim = base.ndim + shape = list(base.shape)[:ndim] + strides = list(base.strides)[:ndim] + space = _space2string(base.space) + dtype = _th.BFdtype_enum(base.dtype) + + return ndarray.__new__(cls, + space=space, + buffer=int(base.data), + shape=shape, + dtype=dtype, + strides=strides + ) + if dtype is not None: dtype = DataType(dtype) if space is None and dtype is None: @@ -184,9 +204,8 @@ def __new__(cls, base=None, space=None, shape=None, dtype=None, base = base.astype(dtype.as_numpy_dtype()) base = ndarray(base) # View base as bf.ndarray if dtype is not None and base.bf.dtype != dtype: - raise TypeError('Unable to convert type %s to %s during ' - 'array construction' % - (base.bf.dtype, dtype)) + raise TypeError(f"Unable to convert type {base.bf.dtype} to {dtype} during " + "array construction") #base = base.view(cls #if dtype is not None: # base = base.astype(DataType(dtype).as_numpy_dtype()) @@ -197,6 +216,7 @@ def __new__(cls, base=None, space=None, shape=None, dtype=None, space=space, shape=base.shape, dtype=base.bf.dtype, + strides=base.strides, native=base.bf.native, conjugated=conjugated) copy_array(obj, base) @@ -332,13 +352,47 @@ def view(self, dtype=None, type_=None): v.bf.dtype = dtype_bf v._update_BFarray() return v - #def astype(self, dtype): - # dtype_bf = DataType(dtype) - # dtype_np = dtype_bf.as_numpy_dtype() - # # TODO: This segfaults for cuda space; need type conversion support in backend - # a = super(ndarray, self).astype(dtype_np) - # a.bf.dtype = dtype_bf - # return a + def astype(self, dtype): + dtype_bf = DataType(dtype) + if space_accessible(self.bf.space, ['system']): + ## For arrays that can be accessed from the system space, use + ## numpy.ndarray.copy() to do the heavy lifting + dtype_np = dtype_bf.as_numpy_dtype() + if self.bf.space == 'cuda_managed': + ## TODO: Decide where/when these need to be called + device.stream_synchronize() + if dtype_bf.is_complex and dtype_bf.is_integer: + ## Catch for the complex integer types + a = ndarray(shape=self.shape, dtype=dtype_bf) + a['re'] = self.real.astype(dtype_bf.as_real()) + a['im'] = self.imag.astype(dtype_bf.as_real()) + else: + a = super(ndarray, self).astype(dtype_np) + a.bf.dtype = dtype_bf + else: + ## For arrays that can be access from CUDA, use bifrost.map + ## to do the heavy lifting + ## TODO: Would it be better to use quantize/unpack instead of map? + a = ndarray(shape=self.shape, dtype=dtype_bf, space=self.bf.space) + if dtype_bf.is_complex: + if self.bf.dtype.is_complex: + ## complex in -> complex out + func_string = b'a.real = b.real; a.imag = b.imag' + else: + ## real in -> complex out + func_string = b'a.real = b; a.imag = 0' + else: + if self.bf.dtype.is_complex: + ## complex in -> real out (plus the standard "drop imag part" warning) + np.ComplexWarning() + func_string = b'a = b.real' + else: + ## real in -> real out + func_string = b'a = b' + _check(_bf.bfMap(0, _array(None, dtype=ctypes.c_long), _array(None), + 2, _array([a.as_BFarray(), self.as_BFarray()]), _array(['a', 'b']), + None, func_string, None, _array(None), _array(None))) + return a def _system_accessible_copy(self): if space_accessible(self.bf.space, ['system']): return self @@ -362,6 +416,42 @@ def copy(self, space=None, order='C'): raise NotImplementedError('Only order="C" is supported') if space is None: space = self.bf.space + if not self.flags['C_CONTIGUOUS']: + # Deal with arrays that need to have their layouts changed + # TODO: Is there a better way to handle this? + if space_accessible(self.bf.space, ['system']): + ## For arrays that can be accessed from the system space, use + ## numpy.ndarray.copy() to do the heavy lifting + if space == 'cuda_managed': + ## TODO: Decide where/when these need to be called + device.stream_synchronize() + ## This actually makes two copies and throws one away + temp = ndarray(shape=self.shape, dtype=self.dtype, space=self.bf.space) + temp[...] = np.array(self).copy() + if self.bf.space != space: + return ndarray(temp, space=space) + return temp + else: + ## For arrays that can be access from CUDA, use bifrost.transpose + ## to do the heavy lifting + ### Figure out the correct axis order for C + permute = np.argsort(self.strides)[::-1] + c_shape = [self.shape[p] for p in permute] + ### Make a BFarray wrapper for self so we can reset shape/strides + ### to what they should be for a C ordered array + self_corder = self.as_BFarray() + shape_type = ctypes.c_long*_bf.BF_MAX_DIMS + self_corder.shape = shape_type(*c_shape) + self_corder.strides = shape_type(*[self.strides[p] for p in permute]) + ### Make a temporary array with the right shape that will be C ordered + temp = ndarray(shape=self.shape, dtype=self.dtype, space=self.bf.space) + ### Run the transpose using the BFarray wrapper and the temporary array + array_type = ctypes.c_int * self.ndim + axes_array = array_type(*permute) + _check(_bf.bfTranspose(self_corder, temp.as_BFarray(), axes_array)) + if self.bf.space != space: + return ndarray(temp, space=space) + return temp # Note: This makes an actual copy as long as space is not None return ndarray(self, space=space) def _key_returns_scalar(self, key): @@ -387,6 +477,15 @@ def __setitem__(self, key, val): else: key = slice(key, key + 1) copy_array(self[key], val) + def as_cupy(self, *args, **kwargs): + import cupy as cp + if space_accessible(self.bf.space, ['cuda']): + umem = cp.cuda.UnownedMemory(self.ctypes.data, self.data.nbytes, self) + mptr = cp.cuda.MemoryPointer(umem, 0) + ca = cp.ndarray(self.shape, dtype=self.dtype, memptr=mptr, strides=self.strides) + else: + ca = cp.asarray(np.array(self)) + return ca def as_GPUArray(self, *args, **kwargs): from pycuda.gpuarray import GPUArray as pycuda_GPUArray g = pycuda_GPUArray(shape=self.shape, dtype=self.dtype, *args, **kwargs) diff --git a/python/bifrost/packet_capture.py b/python/bifrost/packet_capture.py new file mode 100644 index 000000000..f470d6fa9 --- /dev/null +++ b/python/bifrost/packet_capture.py @@ -0,0 +1,176 @@ + +# Copyright (c) 2019-2024, The Bifrost Authors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# **TODO: Write tests for this class + +from bifrost.libbifrost import _bf, _th, _check, _get, BifrostObject +from bifrost.udp_socket import UDPSocket +from bifrost.ring import Ring +from bifrost.ring2 import Ring as Ring2 + +import ctypes +from functools import reduce +from io import IOBase + +from typing import Optional, Union + +from bifrost import telemetry +telemetry.track_module() + +class PacketCaptureCallback(BifrostObject): + _ref_cache = {} + def __init__(self): + BifrostObject.__init__( + self, _bf.bfPacketCaptureCallbackCreate, _bf.bfPacketCaptureCallbackDestroy) + + def set_simple(self, fnc): + self._ref_cache['simple'] = _bf.BFpacketcapture_simple_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetSIMPLE( + self.obj, self._ref_cache['simple'])) + + def set_chips(self, fnc: _bf.BFpacketcapture_chips_sequence_callback): + self._ref_cache['chips'] = _bf.BFpacketcapture_chips_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetCHIPS( + self.obj, self._ref_cache['chips'])) + def set_snap2(self, fnc: _bf.BFpacketcapture_snap2_sequence_callback): + self._ref_cache['snap2'] = _bf.BFpacketcapture_snap2_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetSNAP2( + self.obj, self._ref_cache['snap2'])) + def set_ibeam(self, fnc: _bf.BFpacketcapture_ibeam_sequence_callback): + self._ref_cache['ibeam'] = _bf.BFpacketcapture_ibeam_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetIBeam( + self.obj, self._ref_cache['ibeam'])) + def set_pbeam(self, fnc: _bf.BFpacketcapture_pbeam_sequence_callback): + self._ref_cache['pbeam'] = _bf.BFpacketcapture_pbeam_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetPBeam( + self.obj, self._ref_cache['pbeam'])) + def set_cor(self, fnc: _bf.BFpacketcapture_cor_sequence_callback): + self._ref_cache['cor'] = _bf.BFpacketcapture_cor_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetCOR( + self.obj, self._ref_cache['cor'])) + def set_vdif(self, fnc: _bf.BFpacketcapture_vdif_sequence_callback): + self._ref_cache['vdif'] = _bf.BFpacketcapture_vdif_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetVDIF( + self.obj, self._ref_cache['vdif'])) + def set_tbn(self, fnc: _bf.BFpacketcapture_tbn_sequence_callback): + self._ref_cache['tbn'] = _bf.BFpacketcapture_tbn_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetTBN( + self.obj, self._ref_cache['tbn'])) + def set_drx(self, fnc: _bf.BFpacketcapture_drx_sequence_callback): + self._ref_cache['drx'] = _bf.BFpacketcapture_drx_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetDRX( + self.obj, self._ref_cache['drx'])) + def set_drx8(self, fnc: _bf.BFpacketcapture_drx8_sequence_callback): + self._ref_cache['drx8'] = _bf.BFpacketcapture_drx8_sequence_callback(fnc) + _check(_bf.bfPacketCaptureCallbackSetDRX8( + self.obj, self._ref_cache['drx8'])) + +class _CaptureBase(BifrostObject): + @staticmethod + def _flatten_value(value): + try: + value = reduce(lambda x,y: x*y, value, 1 if value else 0) + except TypeError: + pass + return value + def __enter__(self): + return self + def __exit__(self, type, value, tb): + self.end() + def recv(self) -> _th.BFcapture_enum: + status = _bf.BFpacketcapture_status() + _check(_bf.bfPacketCaptureRecv(self.obj, status)) + return status.value + def flush(self): + _check(_bf.bfPacketCaptureFlush(self.obj)) + def end(self): + _check(_bf.bfPacketCaptureEnd(self.obj)) + +class UDPCapture(_CaptureBase): + def __init__(self, fmt: str, sock: UDPSocket, ring: Union[Ring,Ring2], + nsrc: int, src0: int, max_payload_size: int, buffer_ntime: int, + slot_ntime: int, sequence_callback: PacketCaptureCallback, + core: Optional[int]=None): + nsrc = self._flatten_value(nsrc) + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfUdpCaptureCreate, _bf.bfPacketCaptureDestroy, + fmt.encode(), sock.fileno(), ring.obj, nsrc, src0, + max_payload_size, buffer_ntime, slot_ntime, + sequence_callback.obj, core) + +class UDPSniffer(_CaptureBase): + def __init__(self, fmt: str, sock: UDPSocket, ring: Union[Ring,Ring2], + nsrc: int, src0: int, max_payload_size: int, buffer_ntime: int, + slot_ntime: int, sequence_callback: PacketCaptureCallback, + core: Optional[int]=None): + nsrc = self._flatten_value(nsrc) + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfUdpSnifferCreate, _bf.bfPacketCaptureDestroy, + fmt.encode(), sock.fileno(), ring.obj, nsrc, src0, + max_payload_size, buffer_ntime, slot_ntime, + sequence_callback.obj, core) + +class UDPVerbsCapture(_CaptureBase): + def __init__(self, fmt: str, sock: UDPSocket, ring: Union[Ring,Ring2], + nsrc: int, src0: int, max_payload_size: int, buffer_ntime: int, + slot_ntime: int, sequence_callback: PacketCaptureCallback, + core: Optional[int]=None): + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfUdpVerbsCaptureCreate, _bf.bfPacketCaptureDestroy, + fmt.encode(), sock.fileno(), ring.obj, nsrc, src0, + max_payload_size, buffer_ntime, slot_ntime, + sequence_callback.obj, core) + +class DiskReader(_CaptureBase): + def __init__(self, fmt: str, fh: IOBase, ring: Union[Ring,Ring2], + nsrc: int, src0: int, buffer_nframe: int, slot_nframe: int, + sequence_callback: PacketCaptureCallback, + core: Optional[int]=None): + nsrc = self._flatten_value(nsrc) + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfDiskReaderCreate, _bf.bfPacketCaptureDestroy, + fmt.encode(), fh.fileno(), ring.obj, nsrc, src0, + buffer_nframe, slot_nframe, + sequence_callback.obj, core) + # Make sure we start in the same place in the file + self.seek(fh.tell(), _bf.BF_WHENCE_SET) + def seek(self, offset: int, whence: _th.BFwhence_enum=_bf.BF_WHENCE_CUR): + position = ctypes.c_ulong(0) + _check(_bf.bfPacketCaptureSeek(self.obj, offset, whence, position)) + return position.value + def tell(self) -> int: + position = ctypes.c_ulong(0) + _check(_bf.bfPacketCaptureTell(self.obj, position)) + return position.value diff --git a/python/bifrost/packet_writer.py b/python/bifrost/packet_writer.py new file mode 100644 index 000000000..0fbeae05b --- /dev/null +++ b/python/bifrost/packet_writer.py @@ -0,0 +1,103 @@ + +# Copyright (c) 2019-2024, The Bifrost Authors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# **TODO: Write tests for this class + +from bifrost.libbifrost import _bf, _check, _get, BifrostObject +from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray +from bifrost.udp_socket import UDPSocket + +from io import IOBase + +from typing import Optional + +from bifrost import telemetry +telemetry.track_module() + +class HeaderInfo(BifrostObject): + def __init__(self): + BifrostObject.__init__( + self, _bf.bfHeaderInfoCreate, _bf.bfHeaderInfoDestroy) + def set_nsrc(self, nsrc: int): + _check(_bf.bfHeaderInfoSetNSrc(self.obj, nsrc)) + def set_nchan(self, nchan: int): + _check(_bf.bfHeaderInfoSetNChan(self.obj, nchan)) + def set_chan0(self, chan0: int): + _check(_bf.bfHeaderInfoSetChan0(self.obj, chan0)) + def set_tuning(self, tuning: int): + _check(_bf.bfHeaderInfoSetTuning(self.obj, tuning)) + def set_gain(self, gain: int): + _check(_bf.bfHeaderInfoSetGain(self.obj, gain)) + def set_decimation(self, decimation: int): + _check(_bf.bfHeaderInfoSetDecimation(self.obj, decimation)) + +class _WriterBase(BifrostObject): + def __enter__(self): + return self + def __exit__(self, type, value, tb): + pass + def set_rate_limit(self, rate_limit_pps: int): + _check(_bf.bfPacketWriterSetRateLimit(self.obj, rate_limit_pps)) + def reset_counter(self): + _check(_bf.bfPacketWriterResetCounter(self.obj)) + def send(self, headerinfo: HeaderInfo, + seq: int, seq_increment: int, src: int, src_increment: int, + idata: ndarray): + _check(_bf.bfPacketWriterSend(self.obj, + headerinfo.obj, + seq, + seq_increment, + src, + src_increment, + asarray(idata).as_BFarray())) + +class UDPTransmit(_WriterBase): + def __init__(self, fmt: str, sock: UDPSocket, core: Optional[int]=None): + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfUdpTransmitCreate, _bf.bfPacketWriterDestroy, + fmt.encode(), sock.fileno(), core) + + +class UDPVerbsTransmit(_WriterBase): + def __init__(self, fmt: str, sock: UDPSocket, core: Optional[int]=None): + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfUdpVerbsTransmitCreate, _bf.bfPacketWriterDestroy, + fmt.encode(), sock.fileno(), core) + + +class DiskWriter(_WriterBase): + def __init__(self, fmt: str, fh: IOBase, core: Optional[int]=None): + if core is None: + core = -1 + BifrostObject.__init__( + self, _bf.bfDiskWriterCreate, _bf.bfPacketWriterDestroy, + fmt.encode(), fh.fileno(), core) diff --git a/python/bifrost/pipeline.py b/python/bifrost/pipeline.py index e53c67b38..c8d14a6fc 100644 --- a/python/bifrost/pipeline.py +++ b/python/bifrost/pipeline.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,19 +25,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function import sys -if sys.version_info < (3,): - range = xrange - import threading -try: - import queue -except ImportError: - import Queue as queue +import queue import time import signal +import warnings from copy import copy from collections import defaultdict try: @@ -51,6 +44,12 @@ from bifrost.temp_storage import TempStorage from bifrost.proclog import ProcLog from bifrost.ndarray import memset_array # TODO: This feels a bit hacky +from bifrost.libbifrost import EndOfDataStop + +from graphviz import Digraph + +from collections.abc import Iterable +from typing import Any, Callable, List, Optional, Union from bifrost import telemetry telemetry.track_module() @@ -60,38 +59,41 @@ # module import time to make things easy. device.set_devices_no_spin_cpu() -def izip(*iterables): +def izip(*iterables: Iterable) -> List: while True: - yield [next(it) for it in iterables] + try: + yield [next(it) for it in iterables] + except (EndOfDataStop, StopIteration): + return thread_local = threading.local() thread_local.pipeline_stack = [] -def get_default_pipeline(): +def get_default_pipeline() -> "Pipeline": return thread_local.pipeline_stack[-1] thread_local.blockscope_stack = [] -def get_current_block_scope(): +def get_current_block_scope() -> "BlockScope": if len(thread_local.blockscope_stack): return thread_local.blockscope_stack[-1] else: return None -def block_scope(*args, **kwargs): +def block_scope(*args, **kwargs) -> "BlockScope": return BlockScope(*args, **kwargs) class BlockScope(object): instance_count = 0 def __init__(self, - name=None, - gulp_nframe=None, - buffer_nframe=None, - buffer_factor=None, - core=None, - gpu=None, - share_temp_storage=False, - fuse=False): + name: Optional[str]=None, + gulp_nframe: Optional[int]=None, + buffer_nframe: Optional[int]=None, + buffer_factor: Optional[int]=None, + core: Optional[int]=None, + gpu: Optional[int]=None, + share_temp_storage: bool=False, + fuse: bool=False): if name is None: - name = 'BlockScope_%i' % BlockScope.instance_count + name = f"BlockScope_{BlockScope.instance_count}" BlockScope.instance_count += 1 self._name = name self._gulp_nframe = gulp_nframe @@ -121,7 +123,7 @@ def __exit__(self, type, value, tb): def __getattr__(self, name): # Use child's value if set, othersize defer to parent if '_'+name not in self.__dict__: - raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__, name)) + raise AttributeError(f"'{self.__class__}' object has no attribute '{name}'") self_value = getattr(self, '_' + name) if self_value is not None: return self_value @@ -130,7 +132,7 @@ def __getattr__(self, name): return getattr(self._parent_scope, name) else: return None - def _get_temp_storage(self, space): + def _get_temp_storage(self, space: str) -> TempStorage: if space not in self._temp_storage_: self._temp_storage_[space] = TempStorage(space) return self._temp_storage_[space] @@ -142,31 +144,29 @@ def _get_scope_hierarchy(self): scope_hierarchy.append(parent) parent = parent._parent_scope return reversed(scope_hierarchy) - def cache_scope_hierarchy(self): + def cache_scope_hierarchy(self) -> None: self.scope_hierarchy = self._get_scope_hierarchy() self.fused_ancestor = None for ancestor in self.scope_hierarchy: if ancestor._fused: self.fused_ancestor = ancestor break - def is_fused_with(self, other): + def is_fused_with(self, other: "BlockScope") -> bool: return (self.fused_ancestor is not None and self.fused_ancestor is other.fused_ancestor) - def get_temp_storage(self, space): + def get_temp_storage(self, space: str) -> TempStorage: # TODO: Cache the first share_temp_storage scope to avoid walking each time for scope in self.scope_hierarchy: if scope.share_temp_storage: return scope._get_temp_storage(space) return self._get_temp_storage(space) - def dot_graph(self, parent_graph=None): - from graphviz import Digraph - + def dot_graph(self, parent_graph: Optional[Digraph]=None) -> Digraph: #graph_attr = {'label': self._name} graph_attr = {} if parent_graph is None: - g = Digraph('cluster_' + self._name, graph_attr=graph_attr) + g = Digraph(f"cluster_{self._name}", graph_attr=graph_attr) else: - g = parent_graph.subgraph('cluster_' + self._name, + g = parent_graph.subgraph(f"cluster_{self.name}", label=self._name) for child in self._children: if isinstance(child, Block): @@ -200,11 +200,11 @@ def dot_graph(self, parent_graph=None): g.subgraph(child.dot_graph()) return g -def try_join(thread, timeout=0.): +def try_join(thread: threading.Thread, timeout=0.) -> bool: thread.join(timeout) return not thread.is_alive() # Utility function for joining a collection of threads with a timeout -def join_all(threads, timeout): +def join_all(threads: List[threading.Thread], timeout: Union[int,float]): deadline = time.time() + timeout alive_threads = list(threads) while True: @@ -220,9 +220,9 @@ class PipelineInitError(Exception): class Pipeline(BlockScope): instance_count = 0 - def __init__(self, name=None, **kwargs): + def __init__(self, name: str=None, **kwargs): if name is None: - name = 'Pipeline_%i' % Pipeline.instance_count + name = f"Pipeline_{Pipeline.instance_count}" Pipeline.instance_count += 1 super(Pipeline, self).__init__(name=name, **kwargs) self.blocks = [] @@ -230,8 +230,10 @@ def __init__(self, name=None, **kwargs): self.all_blocks_finished_initializing_event = threading.Event() self.block_init_queue = queue.Queue() def as_default(self): - return PipelineContext(self) - def synchronize_block_initializations(self): + # Add self to the end of the pipeline stack and update the block scope + thread_local.pipeline_stack.append(self) + thread_local.blockscope_stack.append(get_default_pipeline()) + def synchronize_block_initializations(self) -> None: # Wait for all blocks to finish initializing uninitialized_blocks = set(self.blocks) while len(uninitialized_blocks): @@ -241,10 +243,10 @@ def synchronize_block_initializations(self): if not init_succeeded: self.shutdown() raise PipelineInitError( - "The following block failed to initialize: " + block.name) + f"The following block failed to initialize: {block.name}") # Tell blocks that they can begin data processing self.all_blocks_finished_initializing_event.set() - def run(self): + def run(self) -> None: # Launch blocks as threads self.threads = [threading.Thread(target=block.run, name=block.name) for block in self.blocks] @@ -257,7 +259,7 @@ def run(self): # Note: Doing it this way allows signals to be caught here while thread.is_alive(): thread.join(timeout=2**30) - def shutdown(self): + def shutdown(self) -> None: for block in self.blocks: block.shutdown() # Ensure all blocks can make progress @@ -265,8 +267,8 @@ def shutdown(self): join_all(self.threads, timeout=self.shutdown_timeout) for thread in self.threads: if thread.is_alive(): - print("WARNING: Thread %s did not shut down on time and will be killed" % thread.name) - def shutdown_on_signals(self, signals=None): + warnings.warn(f"Thread {thread.name} did not shut down on time and will be killed", RuntimeWarning) + def shutdown_on_signals(self, signals: Optional[List[signal.Signals]]=None) -> None: if signals is None: signals = [signal.SIGHUP, signal.SIGINT, @@ -280,7 +282,7 @@ def _handle_signal_shutdown(self, signum, frame): reversed(sorted(signal.__dict__.items())) if v.startswith('SIG') and not v.startswith('SIG_')) - print("WARNING: Received signal %i %s, shutting down pipeline" % (signum, SIGNAL_NAMES[signum])) + warnings.warn(f"Received signal {signum} {SIGNAL_NAMES[signum]}, shutting down pipeline", RuntimeWarning) self.shutdown() def __enter__(self): thread_local.pipeline_stack.append(self) @@ -294,13 +296,13 @@ def __exit__(self, type, value, tb): thread_local.pipeline_stack.append(Pipeline()) thread_local.blockscope_stack.append(get_default_pipeline()) -def get_ring(block_or_ring): +def get_ring(block_or_ring: Union["Block", Ring]) -> Ring: try: return block_or_ring.orings[0] except AttributeError: return block_or_ring -def block_view(block, header_transform): +def block_view(block: "Block", header_transform: Callable) -> "Block": """View a block with modified output headers Use this function to adjust the output headers of a ring @@ -321,12 +323,12 @@ def block_view(block, header_transform): class Block(BlockScope): instance_counts = defaultdict(lambda: 0) - def __init__(self, irings, - name=None, - type_=None, + def __init__(self, irings: List[Union["Block",Ring]], + name: Optional[str]=None, + type_: Optional[str]=None, **kwargs): self.type = type_ or self.__class__.__name__ - self.name = name or '%s_%i' % (self.type, Block.instance_counts[self.type]) + self.name = name or f"{self.type}_{Block.instance_counts[self.type]}" Block.instance_counts[self.type] += 1 super(Block, self).__init__(**kwargs) self.pipeline = get_default_pipeline() @@ -338,8 +340,7 @@ def __init__(self, irings, valid_inp_spaces = self._define_valid_input_spaces() for i, (iring, valid_spaces) in enumerate(zip(irings, valid_inp_spaces)): if not memory.space_accessible(iring.space, valid_spaces): - raise ValueError("Block %s input %i's space must be accessible from one of: %s" % - (self.name, i, str(valid_spaces))) + raise ValueError(f"Block {self.name} input {i}'s space must be accessible from one of: {valid_spaces}") self.orings = [] # Update this in subclass constructors self.shutdown_event = threading.Event() self.bind_proclog = ProcLog(self.name + "/bind") @@ -347,14 +348,14 @@ def __init__(self, irings, rnames = {'nring': len(self.irings)} for i, r in enumerate(self.irings): - rnames['ring%i' % i] = r.name + rnames[f"ring{i}"] = r.name self.in_proclog.update(rnames) self.init_trace = ''.join(traceback.format_stack()[:-1]) - def shutdown(self): + def shutdown(self) -> None: self.shutdown_event.set() - def create_ring(self, *args, **kwargs): + def create_ring(self, *args, **kwargs) -> Ring: return Ring(*args, owner=self, **kwargs) - def run(self): + def run(self) -> None: #affinity.set_openmp_cores(cpus) # TODO core = self.core if core is not None: @@ -373,10 +374,10 @@ def run(self): sys.stderr.write("From block instantiated here:\n") sys.stderr.write(self.init_trace) raise - def num_outputs(self): + def num_outputs(self) -> int: # TODO: This is a little hacky return len(self.orings) - def begin_writing(self, exit_stack, orings): + def begin_writing(self, exit_stack, orings: List[Ring]) -> List: return [exit_stack.enter_context(oring.begin_writing()) for oring in orings] def begin_sequences(self, exit_stack, orings, oheaders, @@ -412,7 +413,7 @@ def reserve_spans(self, exit_stack, oseqs, igulp_nframes=[]): def commit_spans(self, ospans, ostrides_actual, ogulp_overlaps): # Allow returning None to indicate complete consumption if ostrides_actual is None: - ostrides = [None] * len(ospans) + ostrides_actual = [None] * len(ospans) # Note: If ospan.nframe < ogulp_overlap, no frames will be committed ostrides = [ostride if ostride is not None else max(ospan.nframe - ogulp_overlap, 0) @@ -446,7 +447,7 @@ def __init__(self, sourcenames, gulp_nframe, space=None, *args, **kwargs): rnames = {'nring': len(self.orings)} for i, r in enumerate(self.orings): - rnames['ring%i' % i] = r.name + rnames[f"ring{i}"] = r.name self.out_proclog.update(rnames) def main(self, orings): @@ -459,7 +460,7 @@ def main(self, orings): if 'time_tag' not in ohdr: ohdr['time_tag'] = self._seq_count if 'name' not in ohdr: - ohdr['name'] = 'unnamed-sequence-%i' % self._seq_count + ohdr['name'] = f"unnamed-sequence-{self._seq_count}" self._seq_count += 1 with ExitStack() as oseq_stack: oseqs, ogulp_overlaps = self.begin_sequences( @@ -523,13 +524,13 @@ def __init__(self, irings_, guarantee=True, *args, **kwargs): for iring in self.irings] self._seq_count = 0 self.perf_proclog = ProcLog(self.name + "/perf") - self.sequence_proclogs = [ProcLog(self.name + "/sequence%i" % i) + self.sequence_proclogs = [ProcLog(self.name + f"/sequence{i}") for i in range(len(self.irings))] self.out_proclog = ProcLog(self.name + "/out") rnames = {'nring': len(self.orings)} for i, r in enumerate(self.orings): - rnames['ring%i' % i] = r.name + rnames[f"ring{i}"] = r.name self.out_proclog.update(rnames) def main(self, orings): diff --git a/python/bifrost/portaudio.py b/python/bifrost/portaudio.py index 5053a5ea0..5e32a7e45 100644 --- a/python/bifrost/portaudio.py +++ b/python/bifrost/portaudio.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,13 +31,13 @@ # Ubuntu 16.04: # sudo apt-get install portaudio19-dev -from __future__ import print_function - import ctypes import atexit from threading import Lock import os +from typing import Union + from bifrost import telemetry telemetry.track_module() @@ -112,7 +112,7 @@ class PaDeviceInfo(ctypes.Structure): ctypes.c_ulong] class PortAudioError(RuntimeError): - def __init__(self, msg): + def __init__(self, msg: str): super(PortAudioError, self).__init__(msg) def _check(err): @@ -120,7 +120,7 @@ def _check(err): raise PortAudioError(_lib.Pa_GetErrorText(err)) class suppress_fd(object): - def __init__(self, fd): + def __init__(self, fd: Union[str,int]): if fd.lower() == 'stdout': fd = 1 elif fd.lower() == 'stderr': fd = 2 else: assert(isinstance(fd, int)) @@ -140,13 +140,13 @@ def __exit__(self, type, value, tb): class Stream(object): def __init__(self, - mode='r', - rate=44100, - channels=2, - nbits=16, - frames_per_buffer=1024, - input_device=None, - output_device=None): + mode: str='r', + rate: int=44100, + channels: int=2, + nbits: int=16, + frames_per_buffer: int=1024, + input_device: Optional[str]=None, + output_device: Optional[str]=None): self.mode = mode self.rate = rate self.channels = channels @@ -188,7 +188,7 @@ def __init__(self, None, None)) self.start() - def close(self): + def close(self) -> None: self.stop() with self.lock: _check(_lib.Pa_CloseStream(self.stream)) @@ -196,20 +196,20 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.close() - def start(self): + def start(self) -> None: with self.lock: _check(_lib.Pa_StartStream(self.stream)) self.running = True - def stop(self): + def stop(self) -> None: with self.lock: if self.running: _check(_lib.Pa_StopStream(self.stream)) self.running = False - def read(self, nframe): + def read(self, nframe: int) -> memoryview: nbyte = nframe * self.frame_nbyte buf = ctypes.create_string_buffer("UNINITIALIZED"[:nbyte], nbyte) return self.readinto(buf) - def readinto(self, buf): + def readinto(self, buf: memoryview) -> memoryview: with self.lock: assert(len(buf) % self.frame_nbyte == 0) nframe = len(buf) // self.frame_nbyte @@ -221,27 +221,27 @@ def readinto(self, buf): # packets). _check(_lib.Pa_ReadStream(self.stream, buf_view, nframe)) return buf - def write(self, buf): + def write(self, buf: memoryview) -> memoryview: with self.lock: assert(len(buf) % self.frame_nbyte == 0) nframe = len(buf) // self.frame_nbyte buf_view = (ctypes.c_byte * len(buf)).from_buffer(buf) _check(_lib.Pa_WriteStream(self.stream, buf_view, nframe)) return buf - def time(self): + def time(self) -> int: with self.lock: return _lib.Pa_GetStreamTime(self.stream) -def open(*args, **kwargs): +def open(*args, **kwargs) -> Stream: return Stream(*args, **kwargs) -def get_device_count(): +def get_device_count() -> int: return _lib.Pa_GetDeviceCount() if __name__ == "__main__": import portaudio as audio import numpy as np - print("Found %i audio devices" % audio.get_device_count()) + print(f"Found {audio.get_device_count()} audio devices") with audio.open(nbits=16) as audio_stream: nframe = 20 print(repr(audio_stream.read(nframe).raw)) diff --git a/python/bifrost/proclog.py b/python/bifrost/proclog.py index 4af41535e..7797186d6 100644 --- a/python/bifrost/proclog.py +++ b/python/bifrost/proclog.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,30 +25,23 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function, absolute_import -import sys -if sys.version_info < (3,): - range = xrange - from bifrost.libbifrost import _bf, _check, BifrostObject import os import time +from typing import Any, Dict, Union + from bifrost import telemetry telemetry.track_module() +PROCLOG_DIR = _bf.BF_PROCLOG_DIR + class ProcLog(BifrostObject): - def __init__(self, name): - try: - name = name.encode('utf-8') - except AttributeError: - # Python2 catch - pass + def __init__(self, name: str): BifrostObject.__init__( - self, _bf.bfProcLogCreate, _bf.bfProcLogDestroy, name) - def update(self, contents): + self, _bf.bfProcLogCreate, _bf.bfProcLogDestroy, name.encode()) + def update(self, contents: Union[Dict[str,Any],str]): """Updates (replaces) the contents of the log contents: string or dict containing data to write to the log """ @@ -57,12 +50,7 @@ def update(self, contents): if isinstance(contents, dict): contents = '\n'.join(['%s : %s' % item for item in contents.items()]) - try: - contents = contents.encode() - except AttributeError: - # Python2 catch - pass - _check(_bf.bfProcLogUpdate(self.obj, contents)) + _check(_bf.bfProcLogUpdate(self.obj, contents.encode())) def _multi_convert(value): """ @@ -78,7 +66,7 @@ def _multi_convert(value): pass return value -def load_by_filename(filename): +def load_by_filename(filename: str) -> Dict[str,Any]: """ Function to read in a ProcLog file and return the contents as a dictionary. @@ -111,7 +99,7 @@ def load_by_filename(filename): # Done return contents -def load_by_pid(pid, include_rings=False): +def load_by_pid(pid: int, include_rings: bool=False) -> Dict[str,Any]: """ Function to read in and parse all ProcLog files associated with a given process ID. The contents of these files are returned as a collection of @@ -123,9 +111,9 @@ def load_by_pid(pid, include_rings=False): # Make sure we have a directory to load from - baseDir = os.path.join('/dev/shm/bifrost/', str(pid)) + baseDir = os.path.join(PROCLOG_DIR, str(pid)) if not os.path.isdir(baseDir): - raise RuntimeError("Cannot find log directory associated with PID %s" % pid) + raise RuntimeError(f"Cannot find log directory associated with PID {pid}") # Load contents = {} diff --git a/python/bifrost/psrdada.py b/python/bifrost/psrdada.py index 9706c047d..1e6eb6d50 100644 --- a/python/bifrost/psrdada.py +++ b/python/bifrost/psrdada.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -39,11 +39,10 @@ libtest_la_LDFLAGS = -version-info 0:0:0 """ -from __future__ import absolute_import, print_function - import bifrost.libpsrdada_generated as _dada import numpy as np from bifrost.ndarray import _address_as_buffer +from bifrost.libbifrost import EndOfDataStop import ctypes @@ -57,7 +56,7 @@ class MultiLog(object): count = 0 def __init__(self, name=None): if name is None: - name = "MultiLog%i" % MultiLog.count + name = f"MultiLog{MultiLog.count}" MultiLog.count += 1 self.obj = _dada.multilog_open(name, '\0') def __del__(self): @@ -118,12 +117,12 @@ def __next__(self): else: del block self.reset() - raise StopIteration() + raise EndOfDataStop('IpcBufBlock empty') def next(self): return self.__next__() def open(self): raise NotImplementedError() - def close(self): + def close(self, nbyte): raise NotImplementedError() class IpcBaseIO(IpcBaseBuf): @@ -212,25 +211,25 @@ def _connect(self, buffer_key=0xDADA): self.buffer_key = buffer_key _dada.dada_hdu_set_key(self.hdu, self.buffer_key) if _dada.dada_hdu_connect(self.hdu) < 0: - raise IOError("Could not connect to buffer '%x'" % self.buffer_key) + raise IOError(f"Could not connect to buffer '{self.buffer_key:x}'") def _disconnect(self): if _dada.dada_hdu_disconnect(self.hdu) < 0: - raise IOError("Could not disconnect from buffer '%x'" % self.buffer_key) + raise IOError(f"Could not disconnect from buffer '{self.buffer_key:x}'") def _lock(self, mode): self.mode = mode if mode == 'read': if _dada.dada_hdu_lock_read(self.hdu) < 0: - raise IOError("Could not lock buffer '%x' for reading" % self.buffer_key) + raise IOError(f"Could not lock buffer '{self.buffer_key:x}' for reading") else: if _dada.dada_hdu_lock_write(self.hdu) < 0: - raise IOError("Could not lock buffer '%x' for writing" % self.buffer_key) + raise IOError(f"Could not lock buffer '{self.buffer_key:x}' for writing") def _unlock(self): if self.mode == 'read': if _dada.dada_hdu_unlock_read(self.hdu) < 0: - raise IOError("Could not unlock buffer '%x' for reading" % self.buffer_key) + raise IOError(f"Could not unlock buffer '{self.buffer_key:x}' for reading") else: if _dada.dada_hdu_unlock_write(self.hdu) < 0: - raise IOError("Could not unlock buffer '%x' for writing" % self.buffer_key) + raise IOError(f"Could not unlock buffer '{self.buffer_key:x}' for writing") def relock(self): self._unlock() self._lock(self.mode) diff --git a/python/bifrost/quantize.py b/python/bifrost/quantize.py index 533b686d4..1f9f1df68 100644 --- a/python/bifrost/quantize.py +++ b/python/bifrost/quantize.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,16 +25,14 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray from bifrost import telemetry telemetry.track_module() -def quantize(src, dst, scale=1.): +def quantize(src: ndarray, dst: ndarray, scale: float=1.) -> ndarray: src_bf = asarray(src).as_BFarray() dst_bf = asarray(dst).as_BFarray() _check(_bf.bfQuantize(src_bf, dst_bf, scale)) diff --git a/python/bifrost/rdma.py b/python/bifrost/rdma.py new file mode 100644 index 000000000..aabc99274 --- /dev/null +++ b/python/bifrost/rdma.py @@ -0,0 +1,203 @@ + +# Copyright (c) 2022-2024, The Bifrost Authors. All rights reserved. +# Copyright (c) 2022-2024, The University of New Mexico. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from bifrost.libbifrost import _bf, _th, _check, _get, BifrostObject +from bifrost.ndarray import ndarray, asarray +from bifrost.proclog import ProcLog +import bifrost.affinity as cpu_affinity +from bifrost.udp_socket import UDPSocket +from bifrost.ring import Ring +from bifrost.ring2 import Ring as Ring2 + +import time +import ctypes + +from typing import Optional, Tuple, Union + +from bifrost import telemetry +telemetry.track_module() + +class RdmaSender(BifrostObject): + def __init__(self, sock: UDPSocket, message_size: int): + BifrostObject.__init__( + self, _bf.bfRdmaCreate, _bf.bfRdmaDestroy, + sock.fileno(), message_size, 1) + def send_header(self, time_tag: int, header: str, offset_from_head: int): + header = header.encode() + header_buf = ctypes.create_string_buffer(header) + _check(_bf.bfRdmaSendHeader(self.obj, + time_tag, + len(header), + ctypes.cast(header_buf, ctypes.c_void_p), + offset_from_head)) + def send_span(self, span_data: ndarray): + _check(_bf.bfRdmaSendSpan(self.obj, + asarray(span_data).as_BFarray())) + +class RdmaReceiver(BifrostObject): + def __init__(self, sock: UDPSocket, message_size: int, buffer_factor: int=5): + BifrostObject.__init__( + self, _bf.bfRdmaCreate, _bf.bfRdmaDestroy, + sock.fileno(), message_size, 0) + self.message_size = message_size + self.buffer_factor = buffer_factor + + self.time_tag = ctypes.c_ulong(0) + self.header_size = ctypes.c_ulong(0) + self.offset_from_head = ctypes.c_ulong(0) + self.span_size = ctypes.c_ulong(0) + self.contents_bufs = [] + for i in range(self.buffer_factor): + contents_buf = ctypes.create_string_buffer(self.message_size) + self.contents_bufs.append(contents_buf) + self.index = 0 + def receive(self) -> Union[Tuple[int,int,str],ndarray]: + contents_buf = self.contents_bufs[self.index] + self.index += 1 + if self.index == self.buffer_factor: + self.index = 0 + + _check(_bf.bfRdmaReceive(self.obj, + ctypes.POINTER(ctypes.c_ulong)(self.time_tag), + ctypes.POINTER(ctypes.c_ulong)(self.header_size), + ctypes.POINTER(ctypes.c_ulong)(self.offset_from_head), + ctypes.POINTER(ctypes.c_ulong)(self.span_size), + ctypes.addressof(contents_buf))) + if self.header_size.value > 0: + contents = ctypes.cast(contents_buf, ctypes.c_char_p) + contents = contents.value + return self.time_tag.value, self.header_size.value, contents + else: + span_data = ndarray(shape=(self.span_size.value,), dtype='u8', buffer=ctypes.addressof(contents_buf)) + return span_data + +class RingSender(object): + def __init__(self, iring: Union[Ring,Ring2], sock: UDPSocket, gulp_size: int, + guarantee: bool=True, core: Optional[int]=None): + self.iring = iring + self.sock = sock + self.gulp_size = gulp_size + self.guarantee = guarantee + self.core = core + + self.bind_proclog = ProcLog(type(self).__name__+"/bind") + self.in_proclog = ProcLog(type(self).__name__+"/in") + self.sequence_proclog = ProcLog(type(self).__name__+"/sequence0") + self.perf_proclog = ProcLog(type(self).__name__+"/perf") + + self.in_proclog.update( {'nring':1, 'ring0':self.iring.name}) + + def main(self): + if self.core is not None: + cpu_affinity.set_core(self.core) + self.bind_proclog.update({'ncore': 1, + 'core0': cpu_affinity.get_core(),}) + + sender = RdmaSender(self.sock, self.gulp_size) + + for iseq in self.iring.read(guarantee=self.guarantee): + ihdr = json.loads(iseq.header.tostring()) + sender.send_header(iseq.time_tag, len(ihdr), ihdr, 0) + self.sequence_proclog.update(ihdr) + + prev_time = time.time() + iseq_spans = iseq.read(self.gulp_size) + for ispan in iseq_spans: + if ispan.size < self.gulp_size: + continue + curr_time = time.time() + acquire_time = curr_time - prev_time + prev_time = curr_time + + sender.send_span(ispan) + + curr_time = time.time() + process_time = curr_time - prev_time + prev_time = curr_time + self.perf_proclog.update({'acquire_time': acquire_time, + 'reserve_time': -1, + 'process_time': process_time,}) + + +class RingReceiver(object): + def __init__(self, oring: Union[Ring,Ring2], sock: UDPSocket, gulp_size: int, + guarantee: bool=True, core: Optional[int]=None): + self.oring = oring + self.sock = sock + self.gulp_size = gulp_size + self.guarantee = guarantee + self.core = core + + self.bind_proclog = ProcLog(type(self).__name__+"/bind") + self.out_proclog = ProcLog(type(self).__name__+"/out") + self.sequence_proclog = ProcLog(type(self).__name__+"/sequence0") + self.perf_proclog = ProcLog(type(self).__name__+"/perf") + + self.out_proclog.update( {'nring':1, 'ring0':self.oring.name}) + + def main(self): + if self.core is not None: + cpu_affinity.set_core(self.core) + self.bind_proclog.update({'ncore': 1, + 'core0': cpu_affinity.get_core(),}) + + receiver = RdmaReceiver(self.sock, self.gulp_size) + + with self.oring.begin_writing() as oring: + prev_time = time.time() + data = receiver.receive() + while True: + while not isinstance(data, tuple): + data = receiver.receive() + time_tag, _, ihdr = data + self.sequence_proclog.update(ihdr) + + ohdr = ihdr.copy() + + with oring.begin_sequence(time_tag=time_tag, header=ohdr) as oseq: + while True: + data = receiver.receive() + if isinstance(data, tuple): + break + curr_time = time.time() + acquire_time = curr_time - prev_time + prev_time = curr_time + + with oseq.reserve(self.gulp_size) as ospan: + curr_time = time.time() + reserve_time = curr_time - prev_time + prev_time = curr_time + + odata[...] = data + + curr_time = time.time() + process_time = curr_time - prev_time + prev_time = curr_time + self.perf_proclog.update({'acquire_time': acquire_time, + 'reserve_time': reserve_time, + 'process_time': process_time,}) diff --git a/python/bifrost/reduce.py b/python/bifrost/reduce.py index 05b1cf8ac..a8e9ccd9b 100644 --- a/python/bifrost/reduce.py +++ b/python/bifrost/reduce.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,32 +25,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - -from bifrost.libbifrost import _bf, _check +from bifrost.libbifrost import _bf, _th, _check from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray from bifrost import telemetry telemetry.track_module() -REDUCE_MAP = { - 'sum': _bf.BF_REDUCE_SUM, - 'mean': _bf.BF_REDUCE_MEAN, - 'min': _bf.BF_REDUCE_MIN, - 'max': _bf.BF_REDUCE_MAX, - 'stderr': _bf.BF_REDUCE_STDERR, - 'pwrsum': _bf.BF_REDUCE_POWER_SUM, - 'pwrmean': _bf.BF_REDUCE_POWER_MEAN, - 'pwrmin': _bf.BF_REDUCE_POWER_MIN, - 'pwrmax': _bf.BF_REDUCE_POWER_MAX, - 'pwrstderr': _bf.BF_REDUCE_POWER_STDERR, -} - -def reduce(idata, odata, op='sum'): - if op not in REDUCE_MAP: +def reduce(idata: ndarray, odata: ndarray, op: str='sum') -> ndarray: + try: + op = getattr(_th.BFreduce_enum, op) + except AttributeError: raise ValueError("Invalid reduce op: " + str(op)) - op = REDUCE_MAP[op] _check(_bf.bfReduce(asarray(idata).as_BFarray(), asarray(odata).as_BFarray(), op)) + return odata diff --git a/python/bifrost/ring.py b/python/bifrost/ring.py index 5608d7e24..50bd24854 100644 --- a/python/bifrost/ring.py +++ b/python/bifrost/ring.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,11 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function, absolute_import - -from bifrost.libbifrost import _bf, _check, _get, BifrostObject, _string2space, _space2string -#from GPUArray import GPUArray +from bifrost.libbifrost import _bf, _check, _get, BifrostObject, _string2space, _space2string, EndOfDataStop from bifrost.DataType import DataType from bifrost.ndarray import ndarray, _address_as_buffer @@ -39,6 +35,8 @@ import numpy as np from uuid import uuid4 +from typing import List, Optional, Tuple, Union + from bifrost import telemetry telemetry.track_module() @@ -48,28 +46,23 @@ def _slugify(name): return ''.join([c for c in name if c in valid_chars]) class Ring(BifrostObject): - def __init__(self, space='system', name=None, core=None): + def __init__(self, space: str='system', name: Optional[str]=None, core: Optional[int]=None): if name is None: name = str(uuid4()) name = _slugify(name) - try: - name = name.encode() - except AttributeError: - # Python2 catch - pass space = _string2space(space) #self.obj = None #self.obj = _get(_bf.bfRingCreate(name=name, space=space), retarg=0) BifrostObject.__init__( - self, _bf.bfRingCreate, _bf.bfRingDestroy, name, space) + self, _bf.bfRingCreate, _bf.bfRingDestroy, name.encode(), space) if core is not None: try: _check( _bf.bfRingSetAffinity(self.obj, core) ) except RuntimeError: pass - def resize(self, contiguous_span, total_span=None, nringlet=1, - buffer_factor=4): + def resize(self, contiguous_span: int, total_span: Optional[int]=None, nringlet: int=1, + buffer_factor: int=4) -> None: if total_span is None: total_span = contiguous_span * buffer_factor _check( _bf.bfRingResize(self.obj, @@ -77,13 +70,14 @@ def resize(self, contiguous_span, total_span=None, nringlet=1, total_span, nringlet) ) @property - def name(self): - return _get(_bf.bfRingGetName, self.obj) + def name(self) -> str: + n = _get(_bf.bfRingGetName, self.obj) + return n.decode() @property - def space(self): + def space(self) -> str: return _space2string(_get(_bf.bfRingGetSpace, self.obj)) @property - def core(self): + def core(self) -> int: return _get(_bf.bfRingGetAffinity, self.obj) #def begin_sequence(self, name, header="", nringlet=1): # return Sequence(ring=self, name=name, header=header, nringlet=nringlet) @@ -95,97 +89,73 @@ def core(self): # self._check( self.lib.bfRingUnlock(self.obj) ); #def lock(self): # return RingLock(self) - def begin_writing(self): + def begin_writing(self) -> "RingWriter": return RingWriter(self) def _begin_writing(self): _check( _bf.bfRingBeginWriting(self.obj) ) - def end_writing(self): + def end_writing(self) -> None: _check( _bf.bfRingEndWriting(self.obj) ) - def writing_ended(self): + def writing_ended(self) -> bool: return _get( _bf.bfRingWritingEnded, self.obj ) - def open_sequence(self, name, guarantee=True): + def open_sequence(self, name: str, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, name=name, guarantee=guarantee) - def open_sequence_at(self, time_tag, guarantee=True): + def open_sequence_at(self, time_tag: int, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, which='at', time_tag=time_tag, guarantee=guarantee) - def open_latest_sequence(self, guarantee=True): + def open_latest_sequence(self, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, which='latest', guarantee=guarantee) - def open_earliest_sequence(self, guarantee=True): + def open_earliest_sequence(self, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, which='earliest', guarantee=guarantee) # TODO: Alternative name? - def read(self, whence='earliest', guarantee=True): + def read(self, whence: str='earliest', guarantee: bool=True) -> "ReadSequence": with ReadSequence(self, which=whence, guarantee=guarantee) as cur_seq: while True: - yield cur_seq - cur_seq.increment() - #def _data(self): - # data_ptr = _get(self.lib.bfRingLockedGetData, self.obj) - # #data_ptr = c_void_p() - # #self._check( self.lib.bfRingLockedGetData(self.obj, pointer(data_ptr)) ) - # #data_ptr = data_ptr.value - # #data_ptr = self.lib.bfRingLockedGetData(self.obj) - # if self.space == 'cuda': - # # TODO: See if can wrap this in something like PyCUDA's GPUArray - # # Ideally actual GPUArray, but it doesn't appear to support wrapping pointers - # return data_ptr - # span = self._total_span() - # stride = self._stride() - # nringlet = self._nringlet() - # #print("******", span, stride, nringlet) - # BufferType = c_byte*(nringlet*stride) - # data_buffer_ptr = cast(data_ptr, POINTER(BufferType)) - # data_buffer = data_buffer_ptr.contents - # data_array = np.ndarray(shape=(nringlet, span), - # strides=(stride, 1) if nringlet > 1 else None, - # buffer=data_buffer, dtype=np.uint8) - # return data_array - #def _contiguous_span(self): - # return self._get(BFsize, self.lib.bfRingLockedGetContiguousSpan, self.obj) - #def _total_span(self): - # return self._get(BFsize, self.lib.bfRingLockedGetTotalSpan, self.obj) - #def _nringlet(self): - # return self._get(BFsize, self.lib.bfRingLockedGetNRinglet, self.obj) - #def _stride(self): - # return self._get(BFsize, self.lib.bfRingLockedGetStride, self.obj) + try: + yield cur_seq + cur_seq.increment() + except EndOfDataStop: + return class RingWriter(object): - def __init__(self, ring): + def __init__(self, ring: Ring): self.ring = ring self.ring._begin_writing() def __enter__(self): return self def __exit__(self, type, value, tb): self.ring.end_writing() - def begin_sequence(self, name="", time_tag=-1, header="", nringlet=1): + def begin_sequence(self, name: str="", time_tag: int=-1, + header: str="", nringlet: int=1) -> "WriteSequence": return WriteSequence(ring=self.ring, name=name, time_tag=time_tag, header=header, nringlet=nringlet) class SequenceBase(object): """Python object for a ring's sequence (data unit)""" - def __init__(self, ring): + def __init__(self, ring: Ring): self._ring = ring @property def _base_obj(self): return ctypes.cast(self.obj, _bf.BFsequence) @property - def ring(self): + def ring(self) -> Ring: return self._ring @property - def name(self): - return _get(_bf.bfRingSequenceGetName, self._base_obj) + def name(self) -> str: + n = _get(_bf.bfRingSequenceGetName, self._base_obj) + return n.decode() @property - def time_tag(self): + def time_tag(self) -> int: return _get(_bf.bfRingSequenceGetTimeTag, self._base_obj) @property - def nringlet(self): + def nringlet(self) -> int: return _get(_bf.bfRingSequenceGetNRinglet, self._base_obj) @property - def header_size(self): + def header_size(self) -> int: return _get(_bf.bfRingSequenceGetHeaderSize, self._base_obj) @property def _header_ptr(self): return _get(_bf.bfRingSequenceGetHeader, self._base_obj) @property # TODO: Consider not making this a property - def header(self): + def header(self) -> np.ndarray: size = self.header_size if size == 0: # WAR for hdr_buffer_ptr.contents crashing when size == 0 @@ -198,31 +168,22 @@ def header(self): return hdr_array class WriteSequence(SequenceBase): - def __init__(self, ring, name="", time_tag=-1, header="", nringlet=1): + def __init__(self, ring: Ring, name: str="", time_tag: int=-1, header: str="", nringlet: int=1): SequenceBase.__init__(self, ring) # TODO: Allow header to be a string, buffer, or numpy array header_size = len(header) if isinstance(header, np.ndarray): header = header.ctypes.data elif isinstance(header, str): - try: - header = header.encode() - except AttributeError: - # Python2 catch - pass + header = header.encode() #print("hdr:", header_size, type(header)) name = str(name) offset_from_head = 0 self.obj = _bf.BFwsequence() - try: - name = name.encode() - except AttributeError: - # Python2 catch - pass _check(_bf.bfRingSequenceBegin( self.obj, ring.obj, - name, + name.encode(), time_tag, header_size, header, @@ -232,15 +193,16 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.end() - def end(self): + def end(self) -> None: offset_from_head = 0 _check(_bf.bfRingSequenceEnd(self.obj, offset_from_head)) - def reserve(self, size, nonblocking=False): + def reserve(self, size: int, nonblocking: bool=False) -> "WriteSpan": return WriteSpan(self.ring, size, nonblocking) class ReadSequence(SequenceBase): - def __init__(self, ring, which='specific', name="", time_tag=None, - other_obj=None, guarantee=True): + def __init__(self, ring: Ring, which: str='specific', name: str="", + time_tag: Optional[int]=None, other_obj: Optional[SequenceBase]=None, + guarantee: bool=True): SequenceBase.__init__(self, ring) self._ring = ring self.obj = _bf.BFrsequence() @@ -260,90 +222,71 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.close() - def close(self): + def close(self) -> None: _check(_bf.bfRingSequenceClose(self.obj)) #def __next__(self): # return self.next() #def next(self): # return ReadSequence(self._ring, which='next', other_obj=self.obj) - def increment(self): + def increment(self) -> None: #self._check( self.lib.bfRingSequenceNext(pointer(self.obj)) ) _check(_bf.bfRingSequenceNext(self.obj)) - def acquire(self, offset, size): + def acquire(self, offset: int, size: int) -> "ReadSpan": return ReadSpan(self, offset, size) - def read(self, span_size, stride=None, begin=0): + def read(self, span_size: int, stride: Optional[int]=None, begin: int=0) -> "ReadSpan": if stride is None: stride = span_size offset = begin while True: - with self.acquire(offset, span_size) as ispan: - yield ispan - offset += stride + try: + with self.acquire(offset, span_size) as ispan: + yield ispan + offset += stride + except EndOfDataStop: + return class SpanBase(object): - def __init__(self, ring, writeable): + def __init__(self, ring: Ring, writeable: bool): self._ring = ring self.writeable = writeable @property def _base_obj(self): return ctypes.cast(self.obj, _bf.BFspan) @property - def ring(self): + def ring(self) -> Ring: return self._ring @property - def size(self): + def size(self) -> int: return _get(_bf.bfRingSpanGetSize, self._base_obj) @property - def stride(self): + def stride(self) -> int: return _get(_bf.bfRingSpanGetStride, self._base_obj) @property - def offset(self): + def offset(self) -> int: return _get(_bf.bfRingSpanGetOffset, self._base_obj) @property - def nringlet(self): + def nringlet(self) -> int: return _get(_bf.bfRingSpanGetNRinglet, self._base_obj) @property def _data_ptr(self): return _get(_bf.bfRingSpanGetData, self._base_obj) @property - def data(self): + def data(self) -> ndarray: return self.data_view() - def data_view(self, dtype=np.uint8, shape=-1): + def data_view(self, dtype: Union[str,np.dtype]=np.uint8, + shape: Union[int,List[int],Tuple[int]]=-1) -> ndarray: itemsize = DataType(dtype).itemsize assert( self.size % itemsize == 0 ) assert( self.stride % itemsize == 0 ) data_ptr = self._data_ptr - #if self.sequence.ring.space == 'cuda': - # # TODO: See if can wrap this in something like PyCUDA's GPUArray - # # Ideally actual GPUArray, but it doesn't appear to support wrapping pointers - # # Could also try writing a custom GPUArray implem for this purpose - # return data_ptr span_size = self.size - stride = self.stride - #nringlet = self.sequence.nringlet nringlet = self.nringlet - #print("******", span_size, stride, nringlet) - #BufferType = c_byte*(span_size*self.stride) # TODO: We should really map the actual ring memory space and index # it with offset rather than mapping from the current pointer. - BufferType = ctypes.c_byte * (nringlet * stride) - data_buffer_ptr = ctypes.cast(data_ptr, ctypes.POINTER(BufferType)) - data_buffer = data_buffer_ptr.contents - #print(len(data_buffer), (nringlet, span_size), (self.stride, 1)) _shape = (nringlet, span_size // itemsize) strides = (self.stride, itemsize) if nringlet > 1 else None - #space = self.sequence.ring.space space = self.ring.space - """ - if space != 'cuda': - data_array = np.ndarray(shape=_shape, strides=strides, - buffer=data_buffer, dtype=dtype) - else: - data_array = GPUArray(shape=_shape, strides=strides, - buffer=data_ptr, dtype=dtype) - data_array.flags['SPACE'] = space - """ - + data_array = ndarray(shape=_shape, strides=strides, buffer=data_ptr, dtype=dtype, space=space) @@ -362,24 +305,24 @@ def data_view(self, dtype=np.uint8, shape=-1): class WriteSpan(SpanBase): def __init__(self, - ring, - size, - nonblocking=False): + ring: Ring, + size: int, + nonblocking: bool=False): SpanBase.__init__(self, ring, writeable=True) self.obj = _bf.BFwspan() _check(_bf.bfRingSpanReserve(self.obj, ring.obj, size, nonblocking)) self.commit_size = size - def commit(self, size): + def commit(self, size: int) -> None: self.commit_size = size def __enter__(self): return self def __exit__(self, type, value, tb): self.close() - def close(self): + def close(self) -> None: _check(_bf.bfRingSpanCommit(self.obj, self.commit_size)) class ReadSpan(SpanBase): - def __init__(self, sequence, offset, size): + def __init__(self, sequence: ReadSequence, offset: int, size: int): SpanBase.__init__(self, sequence.ring, writeable=False) self.obj = _bf.BFrspan() _check(_bf.bfRingSpanAcquire(self.obj, sequence.obj, offset, size)) @@ -387,5 +330,5 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.release() - def release(self): + def release(self) -> None: _check(_bf.bfRingSpanRelease(self.obj)) diff --git a/python/bifrost/ring2.py b/python/bifrost/ring2.py index 6f07df942..7da7a4582 100644 --- a/python/bifrost/ring2.py +++ b/python/bifrost/ring2.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,9 +28,7 @@ # TODO: Some of this code has gotten a bit hacky # Also consider merging some of the logic into the backend -from __future__ import print_function, absolute_import - -from bifrost.libbifrost import _bf, _check, _get, BifrostObject, _string2space +from bifrost.libbifrost import _bf, _check, _get, BifrostObject, _string2space, EndOfDataStop from bifrost.DataType import DataType from bifrost.ndarray import ndarray, _address_as_buffer from copy import copy, deepcopy @@ -38,14 +36,18 @@ import ctypes import string +import warnings import numpy as np try: import simplejson as json except ImportError: - print("WARNING: Install simplejson for better performance") + warnings.warn("Install simplejson for better performance", RuntimeWarning) import json +from collections.abc import Iterable +from typing import Any, Callable, Dict, List, Optional, Tuple, Union + from bifrost import telemetry telemetry.track_module() @@ -55,7 +57,7 @@ def _slugify(name): return ''.join([c for c in name if c in valid_chars]) # TODO: Should probably move this elsewhere (e.g., utils) -def split_shape(shape): +def split_shape(shape: Union[List[int],Tuple[int]]) -> Tuple[List[int], List[int]]: """Splits a shape into its ringlet shape and frame shape E.g., (2,3,-1,4,5) -> (2,3), (4,5) """ @@ -67,10 +69,10 @@ def split_shape(shape): ringlet_shape.append(dim) raise ValueError("No time dimension (-1) found in shape") -def compose_unary_funcs(f, g): +def compose_unary_funcs(f: Callable, g: Callable) -> Callable: return lambda x: f(g(x)) -def ring_view(ring, header_transform): +def ring_view(ring: "Ring", header_transform: Callable) -> "Ring": new_ring = ring.view() old_header_transform = ring.header_transform if old_header_transform is not None: @@ -81,21 +83,17 @@ def ring_view(ring, header_transform): class Ring(BifrostObject): instance_count = 0 - def __init__(self, space='system', name=None, owner=None, core=None): + def __init__(self, space: str='system', name: Optional[str]=None, owner: Optional[Any]=None, core: Optional[int]=None): # If this is non-None, then the object is wrapping a base Ring instance self.base = None + self.is_view = False # This gets set to True by use of .view() self.space = space if name is None: name = 'ring_%i' % Ring.instance_count Ring.instance_count += 1 name = _slugify(name) - try: - name = name.encode() - except AttributeError: - # Python2 catch - pass BifrostObject.__init__(self, _bf.bfRingCreate, _bf.bfRingDestroy, - name, _string2space(self.space)) + name.encode(), _string2space(self.space)) if core is not None: try: _check( _bf.bfRingSetAffinity(self.obj, @@ -105,60 +103,59 @@ def __init__(self, space='system', name=None, owner=None, core=None): self.owner = owner self.header_transform = None def __del__(self): - if self.base is not None: + if self.base is not None and not self.is_view: BifrostObject.__del__(self) - def view(self): + def view(self) -> "Ring": new_ring = copy(self) new_ring.base = self + new_ring.is_view = True return new_ring - def resize(self, contiguous_bytes, total_bytes=None, nringlet=1): + def resize(self, contiguous_bytes: int, total_bytes: Optional[int]=None, nringlet: int=1) -> None: _check( _bf.bfRingResize(self.obj, contiguous_bytes, total_bytes, nringlet) ) @property - def name(self): + def name(self) -> str: n = _get(_bf.bfRingGetName, self.obj) - try: - n = n.decode() - except AttributeError: - # Python2 catch - pass - return n + return n.decode() @property - def core(self): + def core(self) -> int: return _get(_bf.bfRingGetAffinity, self.obj) - def begin_writing(self): + def begin_writing(self) -> "RingWriter": return RingWriter(self) def _begin_writing(self): _check( _bf.bfRingBeginWriting(self.obj) ) - def end_writing(self): + def end_writing(self) -> None: _check( _bf.bfRingEndWriting(self.obj) ) - def open_sequence(self, name, guarantee=True): + def open_sequence(self, name: str, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, name=name, guarantee=guarantee) - def open_sequence_at(self, time_tag, guarantee=True): + def open_sequence_at(self, time_tag: int, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, which='at', time_tag=time_tag, guarantee=guarantee) - def open_latest_sequence(self, guarantee=True): + def open_latest_sequence(self, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, which='latest', guarantee=guarantee) - def open_earliest_sequence(self, guarantee=True): + def open_earliest_sequence(self, guarantee: bool=True) -> "ReadSequence": return ReadSequence(self, which='earliest', guarantee=guarantee) # TODO: Alternative name? - def read(self, whence='earliest', guarantee=True): + def read(self, whence: str='earliest', guarantee: bool=True) -> "ReadSequence": with ReadSequence(self, which=whence, guarantee=guarantee, header_transform=self.header_transform) as cur_seq: while True: - yield cur_seq - cur_seq.increment() + try: + yield cur_seq + cur_seq.increment() + except EndOfDataStop: + return class RingWriter(object): - def __init__(self, ring): + def __init__(self, ring: Ring): self.ring = ring self.ring._begin_writing() def __enter__(self): return self def __exit__(self, type, value, tb): self.ring.end_writing() - def begin_sequence(self, header, gulp_nframe, buf_nframe): + def begin_sequence(self, header: Dict[str,Any], gulp_nframe: int, buf_nframe: int): return WriteSequence(ring=self.ring, header=header, gulp_nframe=gulp_nframe, @@ -166,7 +163,7 @@ def begin_sequence(self, header, gulp_nframe, buf_nframe): class SequenceBase(object): """Python object for a ring's sequence (data unit)""" - def __init__(self, ring): + def __init__(self, ring: Ring): self._ring = ring self._header = None self._tensor = None @@ -174,30 +171,26 @@ def __init__(self, ring): def _base_obj(self): return ctypes.cast(self.obj, _bf.BFsequence) @property - def ring(self): + def ring(self) -> Ring: return self._ring @property - def name(self): + def name(self) -> str: n = _get(_bf.bfRingSequenceGetName, self._base_obj) - try: - n = n.decode() - except AttributeError: - pass - return n + return n.decode() @property - def time_tag(self): + def time_tag(self) -> int: return _get(_bf.bfRingSequenceGetTimeTag, self._base_obj) @property - def nringlet(self): + def nringlet(self) -> int: return _get(_bf.bfRingSequenceGetNRinglet, self._base_obj) @property - def header_size(self): + def header_size(self) -> int: return _get(_bf.bfRingSequenceGetHeaderSize, self._base_obj) @property def _header_ptr(self): return _get(_bf.bfRingSequenceGetHeader, self._base_obj) @property - def tensor(self): # TODO: This shouldn't be public + def tensor(self) -> Dict[str,Any]: # TODO: This shouldn't be public if self._tensor is not None: return self._tensor header = self.header @@ -206,11 +199,6 @@ def tensor(self): # TODO: This shouldn't be public nringlet = reduce(lambda x, y: x * y, ringlet_shape, 1) frame_nelement = reduce(lambda x, y: x * y, frame_shape, 1) dtype = header['_tensor']['dtype'] - try: - dtype = dtype.decode() - except AttributeError: - # Python2 catch - pass nbit = DataType(dtype).itemsize_bits assert(nbit % 8 == 0) frame_nbyte = frame_nelement * nbit // 8 @@ -223,7 +211,7 @@ def tensor(self): # TODO: This shouldn't be public self._tensor['dtype_nbyte'] = nbit // 8 return self._tensor @property - def header(self): + def header(self) -> Dict[str,Any]: if self._header is not None: return self._header size = self.header_size @@ -231,15 +219,15 @@ def header(self): # WAR for hdr_buffer_ptr.contents crashing when size == 0 hdr_array = np.empty(0, dtype=np.uint8) hdr_array.flags['WRITEABLE'] = False - return json.loads(hdr_array.tostring()) + return json.loads(hdr_array.tobytes()) hdr_buffer = _address_as_buffer(self._header_ptr, size, readonly=True) hdr_array = np.frombuffer(hdr_buffer, dtype=np.uint8) hdr_array.flags['WRITEABLE'] = False - self._header = json.loads(hdr_array.tostring()) + self._header = json.loads(hdr_array.tobytes()) return self._header class WriteSequence(SequenceBase): - def __init__(self, ring, header, gulp_nframe, buf_nframe): + def __init__(self, ring: Ring, header: Dict[str,Any], gulp_nframe: int, buf_nframe: int): SequenceBase.__init__(self, ring) self._header = header # This allows passing DataType instances instead of string types @@ -249,18 +237,13 @@ def __init__(self, ring, header, gulp_nframe, buf_nframe): tensor = self.tensor # **TODO: Consider moving this into bfRingSequenceBegin self.ring.resize(gulp_nframe * tensor['frame_nbyte'], - buf_nframe * tensor['frame_nbyte'], + buf_nframe * tensor['frame_nbyte'], tensor['nringlet']) offset_from_head = 0 # TODO: How to allow time_tag to be optional? Probably need to plumb support through to backend. self.obj = _bf.BFwsequence() - try: - hname = header['name'].encode() - hstr = header_str.encode() - except AttributeError: - # Python2 catch - hname = header['name'] - hstr = header_str + hname = header['name'].encode() + hstr = header_str.encode() _check(_bf.bfRingSequenceBegin( self.obj, ring.obj, @@ -274,16 +257,16 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.end() - def end(self): + def end(self) -> None: offset_from_head = 0 _check(_bf.bfRingSequenceEnd(self.obj, offset_from_head)) - def reserve(self, nframe, nonblocking=False): + def reserve(self, nframe: int, nonblocking: bool=False) -> "WriteSpan": return WriteSpan(self.ring, self, nframe, nonblocking) class ReadSequence(SequenceBase): - def __init__(self, ring, which='specific', name="", time_tag=None, - other_obj=None, guarantee=True, - header_transform=None): + def __init__(self, ring: Ring, which: str='specific', name: str="", time_tag: Optional[int]=None, + other_obj: Optional[SequenceBase]=None, guarantee: bool=True, + header_transform: Callable=None): SequenceBase.__init__(self, ring) self._ring = ring # A function for transforming the header before it's read @@ -305,25 +288,28 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.close() - def close(self): + def close(self) -> None: _check(_bf.bfRingSequenceClose(self.obj)) - def increment(self): + def increment(self) -> None: _check(_bf.bfRingSequenceNext(self.obj)) # Must invalidate cached header and tensor because this is now # a new sequence. self._header = None self._tensor = None - def acquire(self, frame_offset, nframe): + def acquire(self, frame_offset: int, nframe: int) -> "ReadSpan": return ReadSpan(self, frame_offset, nframe) - def read(self, nframe, stride=None, begin=0): + def read(self, nframe: int, stride: Optional[int]=None, begin: int=0) -> "ReadSpan": if stride is None: stride = nframe offset = begin while True: - with self.acquire(offset, nframe) as ispan: - yield ispan - offset += stride - def resize(self, gulp_nframe, buf_nframe=None, buffer_factor=None): + try: + with self.acquire(offset, nframe) as ispan: + yield ispan + offset += stride + except EndOfDataStop: + return + def resize(self, gulp_nframe: int, buf_nframe: Optional[int]=None, buffer_factor: Optional[int]=None) -> None: if buf_nframe is None: if buffer_factor is None: buffer_factor = 3 @@ -332,7 +318,7 @@ def resize(self, gulp_nframe, buf_nframe=None, buffer_factor=None): return self._ring.resize(gulp_nframe * tensor['frame_nbyte'], buf_nframe * tensor['frame_nbyte']) @property - def header(self): + def header(self) -> Dict[str,Any]: hdr = super(ReadSequence, self).header if self.header_transform is not None: hdr = self.header_transform(deepcopy(hdr)) @@ -340,11 +326,12 @@ def header(self): raise ValueError("Header transform returned None") return hdr -def accumulate(vals, op='+', init=None, reverse=False): +def accumulate(vals: Iterable, op: str='+', init: Optional=None, reverse: bool=False) -> List: if op == '+': op = lambda a, b: a + b elif op == '*': op = lambda a, b: a * b elif op == 'min': op = lambda a, b: min(a, b) elif op == 'max': op = lambda a, b: max(a, b) + else: raise ValueError(f"Invalid operation '{op}'") results = [] if reverse: vals = reversed(list(vals)) @@ -358,7 +345,7 @@ def accumulate(vals, op='+', init=None, reverse=False): return results class SpanBase(object): - def __init__(self, ring, sequence, writeable): + def __init__(self, ring: Ring, sequence: SequenceBase, writeable: bool): self._ring = ring self._sequence = sequence self.writeable = writeable @@ -370,13 +357,13 @@ def _cache_info(self): self._info = _bf.BFspan_info() _check(_bf.bfRingSpanGetInfo(self._base_obj, self._info)) @property - def ring(self): + def ring(self) -> Ring: return self._ring @property - def sequence(self): + def sequence(self) -> SequenceBase: return self._sequence @property - def tensor(self): + def tensor(self) -> Dict[str,Any]: return self._sequence.tensor @property def _size_bytes(self): @@ -387,10 +374,10 @@ def _stride_bytes(self): # **TODO: Change back-end to use long instead of uint64_t return int(self._info.stride) @property - def frame_nbyte(self): + def frame_nbyte(self) -> int: return self._sequence.tensor['frame_nbyte'] @property - def frame_offset(self): + def frame_offset(self) -> int: # ***TODO: I think _info.offset could potentially not be a multiple # of frame_nbyte, because it's set to _tail when data are @@ -412,19 +399,19 @@ def _nringlet(self): def _data_ptr(self): return self._info.data @property - def nframe(self): + def nframe(self) -> int: size_bytes = self._size_bytes assert(size_bytes % self.sequence.tensor['frame_nbyte'] == 0) nframe = size_bytes // self.sequence.tensor['frame_nbyte'] return nframe @property - def shape(self): + def shape(self) -> Union[List[int],Tuple[int]]: shape = (self._sequence.tensor['ringlet_shape'] + [self.nframe] + self._sequence.tensor['frame_shape']) return shape @property - def strides(self): + def strides(self) -> List[int]: tensor = self._sequence.tensor strides = [tensor['dtype_nbyte']] for dim in reversed(tensor['frame_shape']): @@ -436,10 +423,10 @@ def strides(self): strides = list(reversed(strides)) return strides @property - def dtype(self): + def dtype(self) -> Union[str,np.dtype]: return self._sequence.tensor['dtype'] @property - def data(self): + def data(self) -> ndarray: # TODO: This function used to be super slow due to pyclibrary calls # Check whether it still is! @@ -463,10 +450,10 @@ def data(self): class WriteSpan(SpanBase): def __init__(self, - ring, - sequence, - nframe, - nonblocking=False): + ring: Ring, + sequence: WriteSequence, + nframe: int, + nonblocking: bool=False): SpanBase.__init__(self, ring, sequence, writeable=True) nbyte = nframe * self._sequence.tensor['frame_nbyte'] self.obj = _bf.BFwspan() @@ -477,19 +464,19 @@ def __init__(self, self.commit_nframe = 0 # TODO: Why do exceptions here not show up properly? #raise ValueError("SHOW ME THE ERROR") - def commit(self, nframe): + def commit(self, nframe: int) -> None: assert(nframe <= self.nframe) self.commit_nframe = nframe def __enter__(self): return self def __exit__(self, type, value, tb): self.close() - def close(self): + def close(self) -> None: commit_nbyte = self.commit_nframe * self._sequence.tensor['frame_nbyte'] _check(_bf.bfRingSpanCommit(self.obj, commit_nbyte)) class ReadSpan(SpanBase): - def __init__(self, sequence, frame_offset, nframe): + def __init__(self, sequence: ReadSequence, frame_offset: int, nframe: int): SpanBase.__init__(self, sequence.ring, sequence, writeable=False) tensor = sequence.tensor self.obj = _bf.BFrspan() @@ -502,7 +489,7 @@ def __init__(self, sequence, frame_offset, nframe): self.nframe_skipped = min(self.frame_offset - frame_offset, nframe) self.requested_frame_offset = frame_offset @property - def nframe_overwritten(self): + def nframe_overwritten(self) -> int: nbyte_overwritten = ctypes.c_ulong() _check(_bf.bfRingSpanGetSizeOverwritten(self.obj, nbyte_overwritten)) nbyte_overwritten = nbyte_overwritten.value @@ -512,5 +499,5 @@ def __enter__(self): return self def __exit__(self, type, value, tb): self.release() - def release(self): + def release(self) -> None: _check(_bf.bfRingSpanRelease(self.obj)) diff --git a/python/bifrost/romein.py b/python/bifrost/romein.py index 757dd2a0d..760c522f6 100644 --- a/python/bifrost/romein.py +++ b/python/bifrost/romein.py @@ -1,5 +1,5 @@ -# Copyright (c) 2018-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2018-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,11 +25,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check, BifrostObject from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray from bifrost import telemetry telemetry.track_module() @@ -37,19 +35,19 @@ class Romein(BifrostObject): def __init__(self): BifrostObject.__init__(self, _bf.bfRomeinCreate, _bf.bfRomeinDestroy) - def init(self, positions, kernels, ngrid, polmajor=True): + def init(self, positions: ndarray, kernels: ndarray, ngrid: int, polmajor: bool=True) -> None: _check( _bf.bfRomeinInit(self.obj, asarray(positions).as_BFarray(), asarray(kernels).as_BFarray(), ngrid, polmajor) ) - def set_positions(self, positions): + def set_positions(self, positions: ndarray) -> None: _check( _bf.bfRomeinSetPositions(self.obj, asarray(positions).as_BFarray()) ) - def set_kernels(self, kernels): + def set_kernels(self, kernels: ndarray) -> None: _check( _bf.bfRomeinSetKernels(self.obj, asarray(kernels).as_BFarray()) ) - def execute(self, idata, odata): + def execute(self, idata: ndarray, odata: ndarray) -> ndarray: # TODO: Work out how to integrate CUDA stream _check( _bf.bfRomeinExecute(self.obj, asarray(idata).as_BFarray(), diff --git a/python/bifrost/sigproc.py b/python/bifrost/sigproc.py index d5a227ba9..a708abaff 100644 --- a/python/bifrost/sigproc.py +++ b/python/bifrost/sigproc.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -52,13 +52,14 @@ data: [time][pol][nbit] (General case: [time][if/pol][chan][nbit]) """ -from __future__ import print_function - import struct +import warnings import numpy as np from collections import defaultdict import os +from typing import IO, Optional + from bifrost import telemetry telemetry.track_module() @@ -113,8 +114,17 @@ 6: 'GBT', 7: 'GMRT', 8: 'Effelsberg', + 9: 'Effelsberg LOFAR', + 11: 'Unknown', + 12: 'MWA', + 20: 'CHIME', 52: 'LWA-OV', - 53: 'LWA-SV'}) + 53: 'LWA-SV', + 64: 'MeerKAT', + 65: 'KAT-7', + 82: 'eMerlin'}) + + #the machine_id parameter names' translation _MACHINES = defaultdict(lambda: 'unknown', {0: 'FAKE', @@ -126,6 +136,8 @@ 6: 'SCAMP', 7: 'GMRTFB', 8: 'PULSAR2000', + 9: 'UNKNOWN', + 20: 'CHIME', 52: 'LWA-DP', 53: 'LWA-ADP'}) @@ -133,12 +145,7 @@ def _header_write_string(file_object, key): """Writes a single key name to the header, which will be followed by the value""" file_object.write(struct.pack('=i', len(key))) - try: - key = key.encode() - except AttributeError: - # Catch for Python2 - pass - file_object.write(key) + file_object.write(key.encode()) def _header_write_value(file_object, key, value): """Writes a single parameter value to the header""" @@ -159,12 +166,7 @@ def _header_read_one_parameter(file_object): if length <= 0 or length >= 80: return None s = file_object.read(length) - try: - s = s.decode() - except AttributeError: - # Python2 catch - pass - return s + return s.decode() def _write_header(hdr, file_object): """write the entire header to the current position of a file""" @@ -180,8 +182,8 @@ def _write_header(hdr, file_object): elif key == "header_size": pass else: - #raise KeyError("Unknown sigproc header key: %s"%key) - print("WARNING: Unknown sigproc header key: %s" % key) + #raise KeyError(f"Unknown sigproc header key: {key}") + warnings.warn(f"Unknown sigproc header key: '{key}'", RuntimeWarning) _header_write_string(file_object, "HEADER_END") def _read_header(file_object): @@ -210,13 +212,13 @@ def _read_header(file_object): header[expecting] = key expecting = None else: - print("WARNING: Unknown header key", key) + warnings.warn(f"Unknown header key: '{key}'", RuntimeWarning) if 'nchans' not in header: header['nchans'] = 1 header['header_size'] = file_object.tell() return header -def seek_to_data(file_object): +def seek_to_data(file_object: IO[bytes]) -> None: """Go the the location in the file where the data begins""" file_object.seek(0) if _header_read_one_parameter(file_object) != "HEADER_START": @@ -242,22 +244,22 @@ def seek_to_data(file_object): header[expecting] = key expecting = None else: - print("WARNING: Unknown header key", key) + warnings.warn(f"Unknown header key: '{key}'", RuntimeWarning) return -def pack(data, nbit): +def pack(data: np.ndarray, nbit: int) -> np.ndarray: """downgrade data from 8bits to nbits (per value)""" data = data.flatten() if 8 % nbit != 0: raise ValueError("unpack: nbit must divide into 8") if data.dtype not in (np.uint8, np.int8): raise TypeError("unpack: dtype must be 8-bit") - outdata = np.zeros(data.size / (8 / nbit)).astype('uint8') - for index in range(1, 8 / nbit): - outdata += data[index::8 / nbit] / (2**nbit)**index + outdata = np.zeros(data.size // (8 // nbit)).astype('uint8') + for index in range(1, 8 // nbit): + outdata += data[index::8 // nbit] // (2**nbit)**index return outdata -def _write_data(data, nbit, file_object): +def _write_data(data: np.ndarray, nbit: int, file_object: IO[bytes]): """Writes given data to an open file, also packing if needed""" file_object.seek(0, 2) if nbit < 8: @@ -265,7 +267,7 @@ def _write_data(data, nbit, file_object): data.tofile(file_object) # TODO: Move this elsewhere? -def unpack(data, nbit): +def unpack(data: np.ndarray, nbit: int) -> np.ndarray: """upgrade data from nbits to 8bits""" if nbit > 8: raise ValueError("unpack: nbit must be <= 8") @@ -304,7 +306,7 @@ def __init__(self): self.dtype = np.uint8 self.nbits = 8 self.header = {} - def interpret_header(self): + def interpret_header(self) -> None: """redefine variables from header dictionary""" self.nifs = self.header['nifs'] self.nchans = self.header['nchans'] @@ -331,18 +333,18 @@ def __init__(self): self.file_object = None self.mode = '' self.data = np.array([]) - def open(self, filename, mode): + def open(self, filename: str, mode: str) -> "SigprocFile": """open the filename, and read the header and data from it""" if 'b' not in mode: raise NotImplementedError("No support for non-binary files") self.mode = mode self.file_object = open(filename, mode) return self - def clear(self): + def clear(self) -> None: """Erases file contents""" self.file_object.seek(0) self.file_object.truncate() - def close(self): + def close(self) -> None: """closes file object""" self.file_object.close() def __enter__(self): @@ -356,7 +358,7 @@ def _find_nframe_from_file(self): frame_bits = self.header['nifs'] * self.header['nchans'] * self.header['nbits'] nframe = (self.file_object.tell() - curpos) * 8 // frame_bits return nframe - def get_nframe(self): + def get_nframe(self) -> int: """calculate the number of frames from the data""" if self.data.size % self.nifs != 0: raise ValueError @@ -364,11 +366,11 @@ def get_nframe(self): raise ValueError nframe = self.data.size // self.nifs // self.nchans return nframe - def read_header(self): + def read_header(self) -> None: """reads in a header from the file and sets local settings""" self.header = _read_header(self.file_object) self.interpret_header() - def read_data(self, start=None, end=None): + def read_data(self, start: Optional[int]=None, end: Optional[int]=None) -> np.ndarray: """read data from file and store it locally""" nframe = self._find_nframe_from_file() seek_to_data(self.file_object) @@ -377,12 +379,12 @@ def read_data(self, start=None, end=None): if start is not None: if start < 0: read_start = (nframe + start) * self.nifs * self.nchans - elif start >= 0: + else: read_start = start * self.nifs * self.nchans if end is not None: if end < 0: end_read = (nframe + end) * self.nifs * self.nchans - elif end >= 0: + else: end_read = end * self.nifs * self.nchans self.file_object.seek(read_start, os.SEEK_CUR) nbytes_to_read = end_read - read_start @@ -393,12 +395,12 @@ def read_data(self, start=None, end=None): data = unpack(data, self.nbits) self.data = data return self.data - def write_to(self, filename): + def write_to(self, filename: str) -> None: """writes data and header to a different file""" - file_object = open(filename, 'wb') - _write_header(self.header, file_object) - _write_data(self.data, self.nbits, file_object) - def append_data(self, input_data): + with open(filename, 'wb') as file_object: + _write_header(self.header, file_object) + _write_data(self.data, self.nbits, file_object) + def append_data(self, input_data: np.ndarray) -> None: """append data to local data and file""" input_frames = input_data.size // self.nifs // self.nchans input_shape = (input_frames, self.nifs, self.nchans) diff --git a/python/bifrost/sigproc2.py b/python/bifrost/sigproc2.py index 5888a1049..1a89b6e67 100644 --- a/python/bifrost/sigproc2.py +++ b/python/bifrost/sigproc2.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -53,12 +53,13 @@ # See here for details of the different data formats: # https://github.com/SixByNine/sigproc -from __future__ import print_function, division - import struct +import warnings import numpy as np from collections import defaultdict +from typing import Any, Dict, IO, Optional + from bifrost import telemetry telemetry.track_module() @@ -112,11 +113,17 @@ 6: 'GBT', 7: 'GMRT', 8: 'Effelsberg', - 9: 'ATA', + 9: 'Effelsberg LOFAR', + 11: 'Unknown', + 12: 'MWA', + 20: 'CHIME', 10: 'UTR-2', 11: 'LOFAR', 52: 'LWA-OV', - 53: 'LWA-SV'}) + 53: 'LWA-SV', + 64: 'MeerKAT', + 65: 'KAT-7', + 82: 'eMerlin'}) _machines = defaultdict(lambda: 'unknown', {0: 'FAKE', 1: 'PSPM', @@ -127,31 +134,28 @@ 6: 'SCAMP', 7: 'GMRTFB', # aka GBT Pulsar Spigot, SPIGOT 8: 'PULSAR2000', + 9: 'UNKNOWN', + 20: 'CHIME', 11: 'BG/P', 12: "PDEV", 20: 'GUPPI', 52: 'LWA-DP', 53: 'LWA-ADP'}) -def id2telescope(id_): +def id2telescope(id_: int) -> str: return _telescopes[id_] -def telescope2id(name): +def telescope2id(name: str) -> int: # TODO: Would be better to use a pre-made reverse lookup dict - return _telescopes.keys()[_telescopes.values().index(name)] -def id2machine(id_): + return list(_telescopes.keys())[list(_telescopes.values()).index(name)] +def id2machine(id_: int) -> str: return _machines[id_] -def machine2id(name): +def machine2id(name: str) -> int: # TODO: Would be better to use a pre-made reverse lookup dict - return _machines.keys()[_machines.values().index(name)] + return list(_machines.keys())[list(_machines.values()).index(name)] def _header_write_string(f, key): f.write(struct.pack('=i', len(key))) - try: - key = key.encode('ascii') - except AttributeError: - # Catch for Python2 - pass - f.write(key) + f.write(key.encode()) def _header_write(f, key, value, fmt=None): if fmt is not None: pass @@ -171,14 +175,9 @@ def _header_read(f): if length < 0 or length >= 80: return None s = f.read(length) - try: - s = s.decode() - except AttributeError: - # Python2 catch - pass - return s + return s.decode() -def write_header(hdr, f): +def write_header(hdr: Dict[str,Any], f: IO[bytes]): _header_write_string(f, "HEADER_START") for key, val in hdr.items(): if val is None: @@ -194,8 +193,8 @@ def write_header(hdr, f): elif key in _character_values: _header_write(f, key, int(val), fmt='=b') else: - #raise KeyError("Unknown sigproc header key: %s"%key) - print("WARNING: Unknown sigproc header key: %s" % key) + #raise KeyError(f"Unknown sigproc header key: {key}") + warnings.warn(f"Unknown sigproc header key: '{key}'", RuntimeWarning) _header_write_string(f, "HEADER_END") def _read_header(f): @@ -222,7 +221,7 @@ def _read_header(f): header[expecting] = key expecting = None else: - print("WARNING: Unknown header key", key) + warnings.warn(f"Unknown header key: '{key}'", RuntimeWarning) if 'nchans' not in header: header['nchans'] = 1 header['header_size'] = f.tell() @@ -234,7 +233,7 @@ def _read_header(f): return header # TODO: Move this elsewhere? -def unpack(data, nbit): +def unpack(data: np.ndarray, nbit: int) -> np.ndarray: if nbit > 8: raise ValueError("unpack: nbit must be <= 8") if 8 % nbit != 0: @@ -263,15 +262,15 @@ def unpack(data, nbit): x = x << 7 # Shift into high bits to induce sign-extension return x.view(data.dtype) >> 7 else: - raise ValueError("unpack: unexpected nbit! (%i)" % nbit) + raise ValueError(f"unpack: unexpected nbit! ({nbit})") # TODO: Add support for writing # Add support for data_type != filterbank class SigprocFile(object): - def __init__(self, filename=None): + def __init__(self, filename: Optional[str]=None): if filename is not None: self.open(filename) - def open(self, filename): + def open(self, filename: str) -> "SigprocFile": # Note: If nbit < 8, pack_factor = 8 // nbit and the last dimension # is divided by pack_factor, with dtype set to uint8. self.f = open(filename, 'rb') @@ -284,10 +283,11 @@ def open(self, filename): self.signed = bool(self.header['signed']) if self.nbit >= 8: if self.signed: - self.dtype = { 8: np.int8, - 16: np.int16, - 32: np.float32, - 64: np.float64}[self.nbit] + self.dtype : Optional[type] = { + 8: np.int8, + 16: np.int16, + 32: np.float32, + 64: np.float64}[self.nbit] else: self.dtype = { 8: np.uint8, 16: np.uint16, @@ -314,7 +314,7 @@ def open(self, filename): self.frame_nbit = self.frame_size * self.nbit self.frame_nbyte = self.frame_nbit // 8 return self - def close(self): + def close(self) -> None: self.f.close() def __enter__(self): return self @@ -324,14 +324,14 @@ def seek(self, offset, whence=0): if whence == 0: offset += self.header_size self.f.seek(offset, whence) - def bandwidth(self): + def bandwidth(self) -> float: return self.header['nchans'] * self.header['foff'] - def cfreq(self): + def cfreq(self) -> float: return (self.header['fch1'] + 0.5 * (self.header['nchans'] - 1) * self.header['foff']) - def duration(self): + def duration(self) -> float: return self.header['tsamp'] * self.nframe() - def nframe(self): + def nframe(self) -> int: if 'nsamples' not in self.header or self.header['nsamples'] == 0: curpos = self.f.tell() self.f.seek(0, 2) # Seek to end of file @@ -341,12 +341,12 @@ def nframe(self): self.header['nsamples'] = nframe self.f.seek(curpos, 0) # Seek back to where we were return self.header['nsamples'] - def read(self, nframe_or_start, end=None): + def read(self, nframe_or_start: int, end: Optional[int]=None) -> np.ndarray: if end is not None: start = nframe_or_start or 0 if start * self.frame_size * self.nbit % 8 != 0: raise ValueError("Start index must be aligned with byte boundary " + - "(idx=%i, nbit=%i)" % (start, self.nbit)) + f"(idx={start}, nbit={self.nbit})") self.seek(start * self.frame_size * self.nbit // 8) if end == -1: end = self.nframe() @@ -356,18 +356,18 @@ def read(self, nframe_or_start, end=None): if self.nbit < 8: if nframe * self.frame_size * self.nbit % 8 != 0: raise ValueError("No. frames must correspond to whole number of bytes " + - "(idx=%i, nbit=%i)" % (nframe, self.nbit)) + f"(idx={nframe}, nbit={self.nbit})") #data = np.fromfile(self.f, np.uint8, # nframe * self.frame_size * self.nbit // 8) #requested_nbyte = nframe * self.frame_nbyte requested_nbyte = nframe * self.frame_nbyte * self.nbit // 8 if self.buf.nbytes != requested_nbyte: - self.buf.resize(requested_nbyte) + self.buf = np.resize(self.buf, requested_nbyte) nbyte = self.f.readinto(self.buf) if nbyte * 8 % self.frame_nbit != 0: raise IOError("File read returned incomplete frame (truncated file?)") if nbyte < self.buf.nbytes: - self.buf.resize(nbyte) + self.buf = np.resize(self.buf, nbyte) nframe = nbyte * 8 // (self.frame_size * self.nbit) data = self.buf data = unpack(data, self.nbit) @@ -379,17 +379,17 @@ def read(self, nframe_or_start, end=None): nframe = data.size // self.frame_size data = data.reshape((nframe,) + self.frame_shape) return data - def readinto(self, buf): + def readinto(self, buf: Any) -> int: """Fills buf with raw bytes straight from the file""" return self.f.readinto(buf) def __str__(self): hmod = self.header.copy() d = hmod['data_type'] - hmod['data_type'] = "%i (%s)" % (d, _data_types[d]) + hmod['data_type'] = f"{d} ({_data_types[d]})" t = hmod['telescope_id'] - hmod['telescope_id'] = "%i (%s)" % (t, _telescopes[t]) + hmod['telescope_id'] = f"{t} ({_telescopes[t]})" m = hmod['machine_id'] - hmod['machine_id'] = "%i (%s)" % (m, _machines[m]) + hmod['machine_id'] = f"{m} ({_machines[m]})" return '\n'.join(['% 16s: %s' % (key, val) for (key, val) in hmod.items()]) def __getitem__(self, key): diff --git a/python/bifrost/telemetry.py b/python/bifrost/telemetry/__init__.py similarity index 84% rename from python/bifrost/telemetry.py rename to python/bifrost/telemetry/__init__.py index a3b7c342f..a3d1951ae 100644 --- a/python/bifrost/telemetry.py +++ b/python/bifrost/telemetry/__init__.py @@ -1,6 +1,6 @@ -# Copyright (c) 2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2021-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2021-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,50 +26,61 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function, division, absolute_import - import os +import sys import time import uuid import atexit import socket import inspect import warnings -try: - from urllib2 import urlopen - from urllib import urlencode -except ImportError: - from urllib.request import urlopen - from urllib.parse import urlencode +from urllib.request import urlopen +from urllib.parse import urlencode from threading import RLock from functools import wraps import bifrost.version -# Create the cache directory -if not os.path.exists(os.path.join(os.path.expanduser('~'), '.bifrost')): - os.mkdir(os.path.join(os.path.expanduser('~'), '.bifrost')) -_CACHE_DIR = os.path.join(os.path.expanduser('~'), '.bifrost', 'telemetry_cache') -if not os.path.exists(_CACHE_DIR): - os.mkdir(_CACHE_DIR) +_DOT_BIFROST_DIR = os.path.join(os.path.expanduser('~'), '.bifrost') +_CACHE_DIR = os.path.join(_DOT_BIFROST_DIR, 'telemetry_cache') +_ACTIVE_KEY = os.path.join(_CACHE_DIR, 'do_not_report') +try: + # Create the cache directory. If it turns out $HOME doesn't exist or is not + # writable (e.g. in a nix build environment), we disable telemetry in the + # FileNotFoundError handler below. + if not os.path.exists(_DOT_BIFROST_DIR): + os.mkdir(_DOT_BIFROST_DIR) + if not os.path.exists(_CACHE_DIR): + os.mkdir(_CACHE_DIR) -# Load the install ID key, creating it if it doesn't exist -_INSTALL_KEY = os.path.join(_CACHE_DIR, 'install.key') -if not os.path.exists(_INSTALL_KEY): - with open(_INSTALL_KEY, 'w') as fh: - fh.write(str(uuid.uuid4())) + # Load the install ID key, creating it if it doesn't exist + _INSTALL_KEY = os.path.join(_CACHE_DIR, 'install.key') + if not os.path.exists(_INSTALL_KEY): + with open(_INSTALL_KEY, 'w') as fh: + install_id = str(uuid.uuid4()) + try: + import google.colab + install_id = 'c01ab' + install_id[5:] + except ImportError: + pass + fh.write(install_id) + + with open(_INSTALL_KEY, 'r') as fh: + _INSTALL_KEY = fh.read().rstrip() -with open(_INSTALL_KEY, 'r') as fh: - _INSTALL_KEY = fh.read().rstrip() + TELEMETRY_ACTIVE = True + if os.path.exists(_ACTIVE_KEY): + TELEMETRY_ACTIVE = False +except FileNotFoundError: + # Quietly disable telemetry because we don't have a place to write the data + # or configuration. The enable/disable functions will still fail when they + # try to unlink/write _ACTIVE_KEY. + _INSTALL_KEY = str(uuid.uuid4()) + TELEMETRY_ACTIVE = False # Reporting control TELEMETRY_MAX_ENTRIES = 100 TELEMETRY_TIMEOUT = 120 # s -TELEMETRY_ACTIVE = True -_ACTIVE_KEY = os.path.join(_CACHE_DIR, 'do_not_report') -if os.path.exists(_ACTIVE_KEY): - TELEMETRY_ACTIVE = False class _TelemetryClient(object): @@ -82,6 +93,7 @@ def __init__(self, key, version=bifrost.version.__version__): # Setup self.key = key self.version = version + self.py_version = "%i.%i" % (sys.version_info.major, sys.version_info.minor) # Session reference self._session_start = time.time() @@ -137,13 +149,10 @@ def send(self, final=False): payload = urlencode({'timestamp' : int(tNow), 'key' : self.key, 'version' : self.version, + 'py_version' : self.py_version, 'session_time': "%.6f" % ((tNow-self._session_start) if final else 0.0,), 'payload' : payload}) - try: - payload = payload.encode() - except AttributeError: - pass - uh = urlopen('https://fornax.phys.unm.edu/telemetry/bifrost.php', payload, + uh = urlopen('https://fornax.phys.unm.edu/telemetry/bifrost.php', payload.encode(), timeout=TELEMETRY_TIMEOUT) status = uh.read() if status == '': diff --git a/python/bifrost/udp_capture.py b/python/bifrost/telemetry/__main__.py similarity index 58% rename from python/bifrost/udp_capture.py rename to python/bifrost/telemetry/__main__.py index 7349b0330..a693ecd86 100644 --- a/python/bifrost/udp_capture.py +++ b/python/bifrost/telemetry/__main__.py @@ -1,5 +1,6 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2021-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2021-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -24,33 +25,34 @@ # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import argparse -# **TODO: Write tests for this class +from bifrost import telemetry -from bifrost.libbifrost import _bf, _check, BifrostObject +parser = argparse.ArgumentParser( + description='update the Bifrost telemetry setting', + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) +tgroup = parser.add_mutually_exclusive_group(required=False) +tgroup.add_argument('-e', '--enable', action='store_true', + help='enable telemetry for Bifrost') +tgroup.add_argument('-d', '--disable', action='store_true', + help='disable telemetry for Bifrost') +parser.add_argument('-k', '--key', action='store_true', + help='show install identification key') +args = parser.parse_args() -from bifrost import telemetry -telemetry.track_module() +# Toggle +if args.enable: + telemetry.enable() +elif args.disable: + telemetry.disable() + +# Report +## Status +print("Bifrost Telemetry is %s" % ('active' if telemetry.is_active() else 'in-active')) -class UDPCapture(BifrostObject): - def __init__(self, fmt, sock, ring, nsrc, src0, max_payload_size, - buffer_ntime, slot_ntime, sequence_callback, core=None): - if core is None: - core = -1 - BifrostObject.__init__( - self, _bf.bfUdpCaptureCreate, _bf.bfUdpCaptureDestroy, - fmt, sock.fileno(), ring.obj, nsrc, src0, - max_payload_size, buffer_ntime, slot_ntime, - sequence_callback, core) - def __enter__(self): - return self - def __exit__(self, type, value, tb): - self.end() - def recv(self): - status = _bf.BFudpcapture_status() - _check(_bf.bfUdpCaptureRecv(self.obj, status)) - return status - def flush(self): - _check(_bf.bfUdpCaptureFlush(self.obj)) - def end(self): - _check(_bf.bfUdpCaptureEnd(self.obj)) +## Key +if args.key: + print(" Identification key: %s" % telemetry._INSTALL_KEY) diff --git a/python/bifrost/temp_storage.py b/python/bifrost/temp_storage.py index ee48bf863..7dc867c44 100644 --- a/python/bifrost/temp_storage.py +++ b/python/bifrost/temp_storage.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,14 +33,14 @@ telemetry.track_module() class TempStorage(object): - def __init__(self, space): + def __init__(self, space: str): self.space = space self.size = 0 self.ptr = None self.lock = threading.Lock() def __del__(self): self._free() - def allocate(self, size): + def allocate(self, size: int) -> "TempStorageAllocation": return TempStorageAllocation(self, size) def _allocate(self, size): if size > self.size: @@ -52,14 +52,15 @@ def _free(self): bf.memory.raw_free(self.ptr, self.space) self.ptr = None self.size = 0 + class TempStorageAllocation(object): - def __init__(self, parent, size): + def __init__(self, parent: TempStorage, size: int): self.parent = parent self.parent.lock.acquire() self.parent._allocate(size) self.size = parent.size self.ptr = parent.ptr - def release(self): + def release(self) -> None: self.parent.lock.release() def __enter__(self): return self diff --git a/python/bifrost/transpose.py b/python/bifrost/transpose.py index 6ff907963..b15722fd9 100644 --- a/python/bifrost/transpose.py +++ b/python/bifrost/transpose.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,18 +25,18 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray import ctypes +from typing import List, Optional, Tuple, Union + from bifrost import telemetry telemetry.track_module() -def transpose(dst, src, axes=None): +def transpose(dst: ndarray, src: ndarray, axes: Optional[Union[List[int],Tuple[int]]]=None) -> ndarray: if axes is None: axes = reversed(range(len(dst.shape))) dst_bf = asarray(dst).as_BFarray() @@ -44,3 +44,4 @@ def transpose(dst, src, axes=None): array_type = ctypes.c_int * src.ndim axes_array = array_type(*axes) _check(_bf.bfTranspose(src_bf, dst_bf, axes_array)) + return dst diff --git a/python/bifrost/udp_socket.py b/python/bifrost/udp_socket.py index 2f04ef784..fede056e9 100644 --- a/python/bifrost/udp_socket.py +++ b/python/bifrost/udp_socket.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,9 +27,6 @@ # **TODO: Write tests for this class -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check, _get, BifrostObject from bifrost import telemetry @@ -40,6 +37,8 @@ def __init__(self): BifrostObject.__init__(self, _bf.bfUdpSocketCreate, _bf.bfUdpSocketDestroy) def bind(self, local_addr): _check( _bf.bfUdpSocketBind(self.obj, local_addr.obj) ) + def sniff(self, local_addr): + _check( _bf.bfUdpSocketSniff(self.obj, local_addr.obj) ) def connect(self, remote_addr): _check( _bf.bfUdpSocketConnect(self.obj, remote_addr.obj) ) def shutdown(self): @@ -57,3 +56,9 @@ def timeout(self): @timeout.setter def timeout(self, secs): _check( _bf.bfUdpSocketSetTimeout(self.obj, secs) ) + @property + def promisc(self): + return _get(_bf.bfUdpSocketGetPromiscuous, self.obj) + @promisc.setter + def promisc(self, state): + _check( _bf.bfUdpSocketSetPromiscuous(self.obj, state) ) diff --git a/python/bifrost/udp_transmit.py b/python/bifrost/udp_transmit.py deleted file mode 100644 index cb4791281..000000000 --- a/python/bifrost/udp_transmit.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Bifrost Authors nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# **TODO: Write tests for this class - -from bifrost.libbifrost import _bf, _check, BifrostObject - -import ctypes - -from bifrost import telemetry -telemetry.track_module() - -def _packet2pointer(packet): - buf = ctypes.c_char_p(packet) - siz = ctypes.c_uint( len(packet) ) - return buf, siz - -def _packets2pointer(packets): - count = ctypes.c_uint( len(packets) ) - buf = ctypes.c_char_p("".join(packets)) - siz = ctypes.c_uint( len(packets[0]) ) - return buf, siz, count - -class UDPTransmit(BifrostObject): - def __init__(self, sock, core=-1): - BifrostObject.__init__( - self, _bf.bfUdpTransmitCreate, _bf.bfUdpTransmitDestroy, - sock.fileno(), core) - def __enter__(self): - return self - def __exit__(self, type, value, tb): - pass - def send(self, packet): - ptr, siz = _packet2pointer(packet) - _check(_bf.bfUdpTransmitSend(self.obj, ptr, siz)) - def sendmany(self, packets): - assert(type(packets) is list) - ptr, siz, count = _packets2pointer(packets) - _check(_bf.bfUdpTransmitSendMany(self.obj, ptr, siz, count)) diff --git a/python/bifrost/units.py b/python/bifrost/units.py index e9b6e81d6..04547e3c1 100644 --- a/python/bifrost/units.py +++ b/python/bifrost/units.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,22 +27,23 @@ import pint +from typing import Union + from bifrost import telemetry telemetry.track_module() ureg = pint.UnitRegistry() -def convert_units(value, old_units, new_units): +def convert_units(value: Union[int,float], old_units:str, new_units:str) -> Union[int,float]: old_quantity = value * ureg.parse_expression(old_units) try: new_quantity = old_quantity.to(new_units) except pint.DimensionalityError: - raise ValueError("Cannot convert units %s to %s" % - (old_units, new_units)) + raise ValueError(f"Cannot convert units {old_units} to {new_units}") return new_quantity.magnitude # TODO: May need something more flexible, like a Units wrapper class with __str__ -def transform_units(units, exponent): +def transform_units(units: str, exponent: Union[int,float]) -> str: old_quantity = ureg.parse_expression(units) new_quantity = old_quantity**exponent new_units_str = '{:P~}'.format(new_quantity.units) diff --git a/python/bifrost/unpack.py b/python/bifrost/unpack.py index c41f19d9a..2075b980a 100644 --- a/python/bifrost/unpack.py +++ b/python/bifrost/unpack.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,16 +25,14 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import absolute_import - from bifrost.libbifrost import _bf, _check from bifrost.ndarray import asarray +from bifrost.ndarray import ndarray from bifrost import telemetry telemetry.track_module() -def unpack(src, dst, align_msb=False): +def unpack(src: ndarray, dst: ndarray, align_msb: bool=False) -> ndarray: src_bf = asarray(src).as_BFarray() dst_bf = asarray(dst).as_BFarray() _check(_bf.bfUnpack(src_bf, dst_bf, align_msb)) diff --git a/python/bifrost/version/__main__.py b/python/bifrost/version/__main__.py new file mode 100644 index 000000000..0976cc745 --- /dev/null +++ b/python/bifrost/version/__main__.py @@ -0,0 +1,61 @@ + +# Copyright (c) 2021-2022, The Bifrost Authors. All rights reserved. +# Copyright (c) 2021-2022, The University of New Mexico. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import argparse + +from bifrost import __version__, __copyright__, __license__ +from bifrost.libbifrost_generated import * + +def _yes_no(value): + return "yes" if value else "no" + +parser = argparse.ArgumentParser(description='Bifrost version/configuration information') +parser.add_argument('--config', action='store_true', + help='also display configuration information') +args = parser.parse_args() + +print("\n".join(["bifrost " + __version__, __copyright__, "License: " + __license__])) +if args.config: + print("\nConfiguration:") + print(" Memory alignment: %i B" % BF_ALIGNMENT) + print(" OpenMP support: %s" % _yes_no(BF_OPENMP_ENABLED)) + print(" Hardware locality support: %s" % _yes_no(BF_HWLOC_ENABLED)) + print(" Mellanox messaging accelerator (VMA) support: %s" % _yes_no(BF_VMA_ENABLED)) + print(" Infiniband verbs support: %s" % _yes_no(BF_VERBS_ENABLED)) + print(" RDMA ring transport support: %s" % _yes_no(BF_RDMA_ENABLED)) + print(" Logging directory: %s" % BF_PROCLOG_DIR) + print(" Debugging: %s" % _yes_no(BF_DEBUG_ENABLED)) + print(" CUDA support: %s" % _yes_no(BF_CUDA_ENABLED)) + if BF_CUDA_ENABLED: + print(" CUDA version: %.1f" % BF_CUDA_VERSION) + print(" CUDA architectures: %s" % BF_GPU_ARCHS) + print(" CUDA shared memory: %i B" % BF_GPU_SHAREDMEM) + print(" CUDA managed memory support: %s" % _yes_no(BF_GPU_MANAGEDMEM)) + print(" CUDA map disk cache: %s" % _yes_no(BF_MAP_KERNEL_DISK_CACHE)) + print(" CUDA debugging: %s" % _yes_no(BF_CUDA_DEBUG_ENABLED)) + print(" CUDA tracing enabled: %s" % _yes_no(BF_TRACE_ENABLED)) diff --git a/python/bifrost/views/basic_views.py b/python/bifrost/views/basic_views.py index a7ba1e07a..2e525af53 100644 --- a/python/bifrost/views/basic_views.py +++ b/python/bifrost/views/basic_views.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,29 +25,31 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import absolute_import, division - -from bifrost.pipeline import block_view +from bifrost.libbifrost import _bf, _th +from bifrost.pipeline import Block, block_view from bifrost.DataType import DataType from bifrost.units import convert_units -from numpy import isclose +from numpy import dtype as np_dtype, isclose + +from typing import Callable, Optional, Union from bifrost import telemetry telemetry.track_module() -def custom(block, hdr_transform): +def custom(block: Block, hdr_transform: Callable) -> Block: """An alias to `bifrost.pipeline.block_view` """ return block_view(block, hdr_transform) -def rename_axis(block, old, new): +def rename_axis(block: Block, old: str, new: str) -> Block: def header_transform(hdr, old=old, new=new): axis = hdr['_tensor']['labels'].index(old) hdr['_tensor']['labels'][axis] = new return hdr return block_view(block, header_transform) -def reinterpret_axis(block, axis, label, scale=None, units=None): +def reinterpret_axis(block: Block, axis: int, label: str, + scale: Optional[Union[int,float]]=None, units: Optional[str]=None) -> Block: """ Manually reinterpret the scale and/or units on an axis """ def header_transform(hdr, axis=axis, label=label, scale=scale, units=units): tensor = hdr['_tensor'] @@ -62,7 +64,7 @@ def header_transform(hdr, axis=axis, label=label, scale=scale, units=units): return hdr return block_view(block, header_transform) -def reverse_scale(block, axis): +def reverse_scale(block: Block, axis: int) -> Block: """ Manually reverse the scale factor on a given axis""" def header_transform(hdr, axis=axis): tensor = hdr['_tensor'] @@ -72,7 +74,8 @@ def header_transform(hdr, axis=axis): return hdr return block_view(block, header_transform) -def add_axis(block, axis, label=None, scale=None, units=None): +def add_axis(block: Block, axis: int, label: Optional[str]=None, + scale: Optional[Union[int,float]]=None, units: Optional[str]=None) -> Block: """Add an extra dimension to the frame at position 'axis' E.g., if the shape is [-1, 3, 2], then @@ -98,7 +101,7 @@ def header_transform(hdr, axis=axis, label=label, scale=scale, units=units): return hdr return block_view(block, header_transform) -def delete_axis(block, axis): +def delete_axis(block: Block, axis: int) -> Block: """Remove a unitary dimension from the frame E.g., if the shape is [-1, 1, 3, 2], then @@ -111,13 +114,12 @@ def header_transform(hdr, axis=axis): tensor = hdr['_tensor'] specified_axis = axis if isinstance(axis, str): - specified_axis = "'%s'" % specified_axis + specified_axis = f"'{specified_axis}'" axis = tensor['labels'].index(axis) if axis < 0: axis += len(tensor['shape']) + 1 if tensor['shape'][axis] != 1: - raise ValueError("Cannot delete non-unitary axis %s with shape %i" - % (specified_axis, tensor['shape'][axis])) + raise ValueError(f"Cannot delete non-unitary axis {specified_axis} with shape {tensor['shape'][axis]}") del tensor['shape'][axis] if 'labels' in tensor: del tensor['labels'][axis] @@ -128,7 +130,7 @@ def header_transform(hdr, axis=axis): return hdr return block_view(block, header_transform) -def astype(block, dtype): +def astype(block: Block, dtype: Union[str,_th.BFdtype_enum,_bf.BFdtype,np_dtype]) -> Block: def header_transform(hdr, new_dtype=dtype): tensor = hdr['_tensor'] old_dtype = tensor['dtype'] @@ -142,7 +144,7 @@ def header_transform(hdr, new_dtype=dtype): return hdr return block_view(block, header_transform) -def split_axis(block, axis, n, label=None): +def split_axis(block: Block, axis: int, n: int, label: Optional[str]=None) -> Block: # Set function attributes to enable capture in nested function (closure) def header_transform(hdr, axis=axis, n=n, label=label): tensor = hdr['_tensor'] @@ -157,8 +159,7 @@ def header_transform(hdr, axis=axis, n=n, label=label): else: # Axis is not frame axis if shape[axis] % n: - raise ValueError("Split does not evenly divide axis (%i // %i)" % - (tensor['shape'][axis], n)) + raise ValueError(f"Split does not evenly divide axis ({tensor['shape'][axis]} // {n})") shape[axis] //= n shape.insert(axis + 1, n) if 'units' in tensor: @@ -173,7 +174,7 @@ def header_transform(hdr, axis=axis, n=n, label=label): return hdr return block_view(block, header_transform) -def merge_axes(block, axis1, axis2, label=None): +def merge_axes(block: Block, axis1: int, axis2: int, label: Optional[str]=None) -> Block: def header_transform(hdr, axis1=axis1, axis2=axis2, label=label): tensor = hdr['_tensor'] if isinstance(axis1, str): @@ -202,7 +203,7 @@ def header_transform(hdr, axis1=axis1, axis2=axis2, label=label): scale2 = convert_units(scale2, units2, units1) if not isclose(scale1, n * scale2): raise ValueError("Scales of merge axes do not line up: " - "%f != %f" % (scale1, n * scale2)) + f"{scale1} != {n * scale2}") tensor['scales'][axis1][1] = scale2 del tensor['scales'][axis2] del tensor['units'][axis2] diff --git a/python/setup.py b/python/setup.py index 655cd4f04..d7546bf85 100755 --- a/python/setup.py +++ b/python/setup.py @@ -1,5 +1,5 @@ -#!/usr/bin/env python -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +#!/usr/bin/env python3 +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,17 +26,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - -from distutils.command.install import install -from setuptools import setup, find_packages +from setuptools import setup, Extension, find_packages import os import sys import glob # Parse version file to extract __version__ value -bifrost_version_file = 'bifrost/version.py' +bifrost_version_file = 'bifrost/version/__init__.py' try: with open(bifrost_version_file, 'r') as version_file: for line in version_file: @@ -51,27 +47,15 @@ if 'clean' in sys.argv[1:]: sys.exit(0) print("*************************************************************************") - print("Please run `make` from the root of the source tree to generate version.py") + print("Please run `configure` and `make` from the root of the source tree to") + print("generate", bifrost_version_file) print("*************************************************************************") raise -# Override "install" to show the telemetry warning -class bifrost_install(install): - def run(self): - install.run(self) - print("*************************************************************************") - print("By default Bifrost installs with basic Python telemetry enabled in order ") - print("order to help inform how the software is used and to help inform future ") - print("development. You can opt out of telemetry collection using: ") - print(">>> from bifrost import telemetry ") - print(">>> telemetry.disable() ") - print("*************************************************************************") - # Build up a list of scripts to install scripts = glob.glob(os.path.join('..', 'tools', '*.py')) -setup(cmdclass={'install': bifrost_install,}, - name='bifrost', +setup(name='bifrost', version=__version__, description='Pipeline processing framework', author='Ben Barsdell', @@ -79,10 +63,14 @@ def run(self): url='https://github.com/ledatelescope/bifrost', packages=find_packages(), scripts=scripts, + python_requires='>=3.6', install_requires=[ "numpy>=1.8.1", "contextlib2>=0.4.0", "pint>=0.7.0", "graphviz>=0.5.0", + "ctypesgen==1.0.2", "matplotlib" - ]) + ], + ext_package='bifrost', + ext_modules = []) diff --git a/python/typehinting.py b/python/typehinting.py new file mode 100644 index 000000000..915515732 --- /dev/null +++ b/python/typehinting.py @@ -0,0 +1,52 @@ +import os + +# Build a type hinting helper for libbifrost_generated.py +def build_typehinting(filename): + enums = {'status': {}, + 'space': {}, + 'dtype': {}, + 'capture': {}, + 'io': {}, + 'whence': {}, + 'reduce': {}} + + with open(filename, 'r') as fh: + for line in fh: + if line.startswith('BF_'): + for tag in enums.keys(): + if line.startswith(f"BF_{tag.upper()}_"): + name, value = line.split('=', 1) + + name = name.strip().rstrip() + value = value.strip().rstrip() + enums[tag][name] = value + + if tag == 'space': + name = name.replace('BF_SPACE_', '') + enums[tag][name.lower()] = value + elif tag == 'io': + name = name.replace('BF_IO_', '') + enums[tag][name.lower()] = value + elif tag == 'reduce': + name = name.replace('BF_REDUCE_', '') + name = name.replace('POWER_', 'pwr') + enums[tag][name.lower()] = value + break + + outname = filename.replace('generated', 'typehints') + with open(outname, 'w') as fh: + fh.write(f""" +\"\"\" +Type hints generated from {filename} + +Do not modify this file. +\"\"\" + +import enum + +""") + for tag in enums.keys(): + fh.write(f"class BF{tag}_enum(enum.IntEnum):\n") + for key,value in enums[tag].items(): + fh.write(f" {key} = {value}\n") + fh.write("\n") diff --git a/share/bifrost.m4 b/share/bifrost.m4 new file mode 100644 index 000000000..6f7790a2c --- /dev/null +++ b/share/bifrost.m4 @@ -0,0 +1,45 @@ +AC_DEFUN([AX_CHECK_BIFROST], +[ + AC_PROVIDE([AX_CHECK_BIFROST]) + AC_ARG_WITH([bifrost], + [AS_HELP_STRING([--with-bifrost], + [Bifrost install path (default=/usr/local)])], + [], + [with_bifrost=/usr/local/]) + AC_SUBST([BIFROST_PATH], [$with_bifrost]) + + AC_SUBST([HAVE_BIFROST], [1]) + AC_CHECK_HEADER([bifrost/config.h], [], [AC_SUBST([HAVE_BIFROST], [0])]) + if test "$HAVE_BIFROST" = "1"; then + AC_MSG_CHECKING([for a working Bifrost installation]) + + CPPFLAGS_save="$CPPFLAGS" + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + CPPFLAGS="$CPPFLAGS -L$with_bifrost" + LDFLAGS="$LDFLAGS -L$with_bifrost" + LIBS="$LIBS -lbifrost" + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include ]], + [[bfGetCudaEnabled();]])], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_SUBST([HAVE_BIFROST], [0])]) + + CPPFLAGS="$CPPFLAGS_save" + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + fi + + if test "$HAVE_BIFROST" = "1"; then + CPPFLAGS="$CPPFLAGS -L$with_bifrost" + LDFLAGS="$LDFLAGS -L$with_bifrost" + LIBS="$LIBS -lbifrost" + fi +]) diff --git a/share/bifrost.pc.in b/share/bifrost.pc.in new file mode 100644 index 000000000..1a038acc9 --- /dev/null +++ b/share/bifrost.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: bifrost +Description: A stream processing framework for high-throughput applications. +Requires: +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lbifrost +Cflags: -I${includedir} diff --git a/src/Complex.hpp b/src/Complex.hpp index 47f218f3c..5730b7cbd 100644 --- a/src/Complex.hpp +++ b/src/Complex.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -88,6 +88,16 @@ inline __host__ __device__ void quantize(F f, unsigned short* q) { *q = max(min(rint(f), +65535), 0); } +template +inline __host__ __device__ +void quantize(F f, signed int* q) { + *q = max(min(rint(f), +2147483647), -2147483647); +} +template +inline __host__ __device__ +void quantize(F f, unsigned int* q) { + *q = max(min(rint(f), +4294967295), 0); +} template inline __host__ __device__ @@ -111,10 +121,9 @@ template<> struct is_floating_point { enum { value = true }; }; template struct is_storage_type { enum { value = false }; }; template<> struct is_storage_type { enum { value = true }; }; template<> struct is_storage_type { enum { value = true }; }; -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 +template<> struct is_storage_type { enum { value = true }; }; // TODO: Complex breaks because there's no half(int) constructor //template<> struct is_storage_type { enum { value = true }; }; -#endif #ifdef __CUDACC_VER_MAJOR__ template struct cuda_vector2_type {}; @@ -169,11 +178,11 @@ Complex c) : x(((signed char) (c.real_imag & 0xF0))/16), y(((signed char) ((c.real_imag & 0x0F) << 4))/16) {} inline __host__ __device__ Complex(Complex c) : x(c.x), y(c.y) {} inline __host__ __device__ Complex(Complex c) : x(c.x), y(c.y) {} -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 + inline __host__ __device__ Complex(Complex c) : x(c.x), y(c.y) {} //inline __device__ Complex(Complex c) : x(__half2float(c.x)), y(__half2float(c.y)) {} -#endif #ifdef __CUDACC_VER_MAJOR__ // Note: Use float2 to ensure vectorized load/store inline __host__ __device__ Complex(typename Complex_detail::cuda_vector2_type::type c) : x(c.x), y(c.y) {} @@ -291,7 +300,6 @@ inline T type_pun(U x) { } #ifdef __CUDA_ARCH__ -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 __device__ inline Complex __shfl_sync(unsigned mask, Complex const& c, int index, int width=warpSize) { @@ -299,15 +307,6 @@ inline Complex __shfl_sync(unsigned mask, Complex const& c, return detail::type_pun >( __shfl_sync(mask, detail::type_pun(c), index, width)); } -#else -__device__ -inline Complex __shfl(Complex const& c, - int index, int width=warpSize) { - typedef unsigned long long shfl_type; - return detail::type_pun >( - __shfl(detail::type_pun(c), index, width)); -} -#endif #endif // __CUDA_ARCH__ __host__ __device__ diff --git a/src/Makefile b/src/Makefile.in similarity index 53% rename from src/Makefile rename to src/Makefile.in index 6fcc5db97..ca576c6fa 100644 --- a/src/Makefile +++ b/src/Makefile.in @@ -2,24 +2,60 @@ .SILENT: include ../config.mk -include ../user.mk + +CXX ?= @CXX@ +NVCC ?= @NVCC@ +LINKER ?= @CXX@ +CPPFLAGS ?= @CPPFLAGS@ +CXXFLAGS ?= @CXXFLAGS@ +NVCCFLAGS ?= @NVCCFLAGS@ +LDFLAGS ?= @LDFLAGS@ @LIBS@ +DOXYGEN ?= @DX_DOXYGEN@ +PYBUILDFLAGS ?= @PYBUILDFLAGS@ +PYINSTALLFLAGS ?= @PYINSTALLFLAGS@ + +HAVE_RECVMSG ?= @HAVE_RECVMSG@ +HAVE_RDMA ?= @HAVE_RDMA@ + +HAVE_CUDA ?= @HAVE_CUDA@ + +GPU_ARCHS ?= @GPU_ARCHS@ + +CUDA_HOME ?= @CUDA_HOME@ +CUDA_LIBDIR ?= $(CUDA_HOME)/lib +CUDA_LIBDIR64 ?= $(CUDA_HOME)/lib64 +CUDA_INCDIR ?= $(CUDA_HOME)/include + +NVCC_GENCODE ?= @NVCC_GENCODE@ LIBBIFROST_OBJS = \ common.o \ memory.o \ affinity.o \ + hw_locality.o \ cuda.o \ + fileutils.o \ + testsuite.o \ ring.o \ ring_impl.o \ + Socket.o \ array.o \ - address.o \ - udp_socket.o \ - udp_capture.o \ - udp_transmit.o \ unpack.o \ quantize.o \ proclog.o -ifndef NOCUDA +ifeq ($(HAVE_RECVMSG),1) + # These files require recvmsg to compile + LIBBIFROST_OBJS += \ + address.o \ + udp_socket.o \ + packet_capture.o \ + packet_writer.o +endif +ifeq ($(HAVE_RDMA),1) + LIBBIFROST_OBJS += \ + rdma.o +endif +ifeq ($(HAVE_CUDA),1) # These files require the CUDA Toolkit to compile LIBBIFROST_OBJS += \ transpose.o \ @@ -46,79 +82,14 @@ JIT_SOURCES ?= \ ShapeIndexer.cuh.jit \ int_fastdiv.h.jit -MAKEFILES = ../config.mk ../user.mk Makefile - -ifndef NOCUDA -# All CUDA archs supported by this version of nvcc -GPU_ARCHS_SUPPORTED := $(shell $(NVCC) -h | grep -Po "compute_[0-9]{2}" | cut -d_ -f2 | sort | uniq) -# Intersection of user-specified archs and supported archs -GPU_ARCHS_VALID := $(shell echo $(GPU_ARCHS) $(GPU_ARCHS_SUPPORTED) | xargs -n1 | sort | uniq -d | xargs) -# Latest valid arch -GPU_ARCH_LATEST := $(shell echo $(GPU_ARCHS_VALID) | rev | cut -d' ' -f1 | rev) - -# This creates SASS for all valid requested archs, and PTX for the latest one -NVCC_GENCODE ?= $(foreach arch, $(GPU_ARCHS_VALID), \ - -gencode arch=compute_$(arch),\"code=sm_$(arch)\") \ - -gencode arch=compute_$(GPU_ARCH_LATEST),\"code=compute_$(GPU_ARCH_LATEST)\" -endif - -CXXFLAGS += -std=c++11 -fPIC -fopenmp -NVCCFLAGS += -std=c++11 -Xcompiler "-fPIC" $(NVCC_GENCODE) -DBF_GPU_SHAREDMEM=$(GPU_SHAREDMEM) +MAKEFILES = ../config.mk Makefile #NVCCFLAGS += -Xcudafe "--diag_suppress=unrecognized_gcc_pragma" #NVCCFLAGS += --expt-relaxed-constexpr -ifndef NODEBUG - CPPFLAGS += -DBF_DEBUG=1 - CXXFLAGS += -g - NVCCFLAGS += -g -endif - -LIB += -lgomp - -ifdef TRACE - CPPFLAGS += -DBF_TRACE_ENABLED=1 -endif - -ifdef NUMA - # Requires libnuma-dev to be installed - LIB += -lnuma - CPPFLAGS += -DBF_NUMA_ENABLED=1 -endif - -ifdef HWLOC - # Requires libhwloc-dev to be installed - LIB += -lhwloc - CPPFLAGS += -DBF_HWLOC_ENABLED=1 -endif - -ifdef VMA - # Requires Mellanox libvma to be installed - LIB += -lvma - CPPFLAGS += -DBF_VMA_ENABLED=1 -endif - -ifdef ALIGNMENT - CPPFLAGS += -DBF_ALIGNMENT=$(ALIGNMENT) -endif - -ifdef CUDA_DEBUG - NVCCFLAGS += -G -endif - -ifndef NOCUDA - CPPFLAGS += -DBF_CUDA_ENABLED=1 - LIB += -L$(CUDA_LIBDIR64) -L$(CUDA_LIBDIR) -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt -endif - -ifndef ANY_ARCH - CXXFLAGS += -march=native - NVCCFLAGS += -Xcompiler "-march=native" -endif - LIB_DIR = ../lib INC_DIR = . -CPPFLAGS += -I. -I$(INC_DIR) -I$(CUDA_INCDIR) +CPPFLAGS += -I. -I$(INC_DIR) LIBBIFROST_VERSION_FILE = $(LIBBIFROST_NAME).version LIBBIFROST_SO_STEM = $(LIB_DIR)/$(LIBBIFROST_NAME)$(SO_EXT) @@ -129,25 +100,19 @@ all: $(LIBBIFROST_SO) .PHONY: all $(LIBBIFROST_VERSION_FILE): $(INC_DIR)/bifrost/*.h - $(CLEAR_LINE) - @echo -n "Generating $(LIBBIFROST_VERSION_FILE)\r" - ctags --version | grep -q "Exuberant" || {\ - echo "*************************************" && \ - echo "ERROR: Please install exuberant-ctags" && \ - echo "*************************************" && \ - false; } + @echo "Generating $(LIBBIFROST_VERSION_FILE)" echo "VERS_$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) {" > $@ echo " global:" >> $@ - ctags -x --c-kinds=p $^ | awk '{print " " $$1 ";"}' >> $@ + @CTAGS@ -x --c-kinds=p $^ | @AWK@ '{print " " $$1 ";"}' >> $@ echo " local:" >> $@ echo " *;" >> $@ echo "};" >> $@ -ifndef NOCUDA +ifeq ($(HAVE_CUDA),1) # TODO: Need to deal with 32/64 detection here LIBCUFFT_STATIC = $(CUDA_LIBDIR64)/libcufft_static.a # All PTX archs included in the lib (typically only one) -CUFFT_PTX_ARCHS := $(shell cuobjdump --list-ptx $(LIBCUFFT_STATIC) | grep -Po "sm_[0-9]{2}" | cut -d_ -f2 | sort | uniq) +CUFFT_PTX_ARCHS := $(shell @CUOBJDUMP@ --list-ptx $(LIBCUFFT_STATIC) | grep -Po "sm_[0-9]{2}" | cut -d_ -f2 | sort | uniq) # Latest PTX arch included in the lib CUFFT_PTX_LATEST_ARCH := $(shell echo $(CUFFT_PTX_ARCHS) | rev | cut -d' ' -f1 | rev) CUFFT_STATIC_GENCODE = -gencode arch=compute_$(CUFFT_PTX_LATEST_ARCH),\"code=compute_$(CUFFT_PTX_LATEST_ARCH)\" @@ -157,13 +122,12 @@ libcufft_static_pruned.a: $(LIBCUFFT_STATIC) Makefile # E.g., We may have GPU_ARCHS="35 61" but libcufft_static might only # include sm_60 and compute_60, so we need to keep compute_60 in order # to support sm_61. - nvprune -o $@ $(NVCC_GENCODE) $(CUFFT_STATIC_GENCODE) $< + @NVPRUNE@ -o $@ $(NVCC_GENCODE) $(CUFFT_STATIC_GENCODE) $< fft_kernels.o: fft_kernels.cu fft_kernels.h Makefile # Note: This needs to be compiled with "-dc" to make CUFFT callbacks work $(NVCC) $(NVCCFLAGS) $(CPPFLAGS) -Xcompiler "$(GCCFLAGS)" -dc $(OUTPUT_OPTION) $< _cuda_device_link.o: Makefile fft_kernels.o libcufft_static_pruned.a - $(CLEAR_LINE) - @echo -n "Linking _cuda_device_link.o\r" + @echo "Linking _cuda_device_link.o" # TODO: "nvcc -dlink ..." does not error or warn when a -lblah is not found @ls ./libcufft_static_pruned.a > /dev/null $(NVCC) -dlink -o $@ $(NVCCFLAGS) fft_kernels.o -L. -lcufft_static_pruned @@ -172,15 +136,18 @@ else CUDA_DEVICE_LINK_OBJ = endif +WLFLAGS ?= $(SONAME_FLAG),$(LIBBIFROST_NAME)$(SO_EXT).$(LIBBIFROST_MAJOR) +ifeq ($(OS),Linux) + WLFLAGS := --version-script=$(LIBBIFROST_VERSION_FILE),$(WLFLAGS) +endif + # Note: $(LIB) must go at after OBJS $(LIBBIFROST_SO): $(LIBBIFROST_OBJS) $(LIBBIFROST_VERSION_FILE) $(CUDA_DEVICE_LINK_OBJ) - $(CLEAR_LINE) - @echo -n "Linking $(LIBBIFROST_SO_NAME)\r" + @echo "Linking $(LIBBIFROST_SO_NAME)" mkdir -p $(LIB_DIR) - $(LINKER) $(SHARED_FLAG) -Wl,--version-script=$(LIBBIFROST_VERSION_FILE),$(SONAME_FLAG),$(LIBBIFROST_NAME)$(SO_EXT).$(LIBBIFROST_MAJOR) -o $@ $(LIBBIFROST_OBJS) $(CUDA_DEVICE_LINK_OBJ) $(LIB) $(LDFLAGS) + $(LINKER) $(SHARED_FLAG) -Wl,$(WLFLAGS) -o $@ $(LIBBIFROST_OBJS) $(CUDA_DEVICE_LINK_OBJ) $(LIB) $(LDFLAGS) ln -s -f $(LIBBIFROST_SO_NAME) $(LIBBIFROST_SO_STEM).$(LIBBIFROST_MAJOR) ln -s -f $(LIBBIFROST_SO_NAME) $(LIBBIFROST_SO_STEM) - $(CLEAR_LINE) @echo "Successfully built $(LIBBIFROST_SO_NAME)" *.o: $(MAKEFILES) @@ -188,10 +155,9 @@ $(LIBBIFROST_SO): $(LIBBIFROST_OBJS) $(LIBBIFROST_VERSION_FILE) $(CUDA_DEVICE_LI map.o: $(JIT_SOURCES) stringify: stringify.cpp - g++ -o stringify -Wall -O3 stringify.cpp + $(CXX) -o stringify -Wall -O3 stringify.cpp %.jit: % stringify - @$(CLEAR_LINE) - @echo -n "Building JIT version of $<\r" + @echo "Building JIT version of $<" ./stringify $< > $@ clean: diff --git a/src/Socket.cpp b/src/Socket.cpp new file mode 100644 index 000000000..cec457c24 --- /dev/null +++ b/src/Socket.cpp @@ -0,0 +1,913 @@ +/* -*- indent-tabs-mode:nil -*- + * Copyright (c) 2022, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "Socket.hpp" + +#if defined __APPLE__ && __APPLE__ + +static int accept4(int sockfd, + struct sockaddr *addr, + socklen_t *addrlen, + int flags) { + return ::accept(sockfd, addr, addrlen); +} + +static sa_family_t get_family(int sockfd) { + sockaddr addr; + socklen_t addr_len = sizeof(addr); + sockaddr_in* addr4 = reinterpret_cast(&addr); + if( ::getsockname(sockfd, (struct sockaddr*)&addr, &addr_len) < 0 ) { + return AF_UNSPEC; + } + return addr4->sin_family; +} + +static int get_mtu(int sockfd) { + int mtu = 0; + sa_family_t family = ::get_family(sockfd); + + sockaddr_storage addr; + socklen_t addr_len = sizeof(addr); + sockaddr_in* addr4 = reinterpret_cast (&addr); + sockaddr_in6* addr6 = reinterpret_cast(&addr); + ::getsockname(sockfd, (struct sockaddr*)&addr, &addr_len); + + ifaddrs* ifaddr; + if( ::getifaddrs(&ifaddr) == -1 ) { + return 0; + } + + ifreq ifr; + bool found = false; + for( ifaddrs* ifa=ifaddr; ifa!=NULL; ifa=ifa->ifa_next ) { + if( ifa->ifa_addr == NULL || found) { + continue; + } + sa_family_t ifa_family = ifa->ifa_addr->sa_family; + if( (family == AF_UNSPEC && (ifa_family == AF_INET || + ifa_family == AF_INET6)) || + ifa_family == family ) { + if( ifa_family == AF_INET ) { + struct sockaddr_in* inaddr = (struct sockaddr_in*) ifa->ifa_addr; + if( inaddr->sin_addr.s_addr == addr4->sin_addr.s_addr ) { + found = true; + } + } else if( ifa_family == AF_INET6 ) { + struct sockaddr_in6* inaddr6 = (struct sockaddr_in6*) ifa->ifa_addr; + if( std::memcmp(inaddr6->sin6_addr.s6_addr, addr6->sin6_addr.s6_addr, 16) == 0 ) { + found = true; + } + } + } + + if( found ) { + ::strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ-1); + ifr.ifr_name[IFNAMSIZ-1] = '\0'; + if( ::ioctl(sockfd, SIOCGIFMTU, &ifr) != -1) { + mtu = ifr.ifr_mtu; + } + } + } + ::freeifaddrs(ifaddr); + + return mtu; +} + +// TODO: What about recvmsg_x? +int recvmmsg(int sockfd, + struct mmsghdr *msgvec, + unsigned int vlen, + int flags, + struct timespec *timeout) { + int count = 0; + int recv; + for(unsigned int i=0; i 0) { + count++; + } + } + return count; +} + +// TODO: What about sendmsg_x? +int sendmmsg(int sockfd, + struct mmsghdr *msgvec, + unsigned int vlen, + int flags) { + int count = 0; + int sent; + for(unsigned int i=0; i (&sas); + sockaddr_in6* sa6 = reinterpret_cast(&sas); + sockaddr_un* saU = reinterpret_cast (&sas); + //if( !addrstr || !std::strlen(addrstr) ) { + if( addrstr.empty() ) { + // No address means "any address" + sas.ss_family = family; + switch( family ) { + case AF_INET: { + sa4->sin_addr.s_addr = htonl(INADDR_ANY); + sa4->sin_port = htons(port); + break; + } + case AF_INET6: { + ::memcpy(&sa6->sin6_addr, &in6addr_any, sizeof(in6addr_any)); + sa4->sin_port = htons(port); + break; + } + case AF_UNIX: // Fall-through + case AF_UNSPEC: // Fall-through + default: break; // Leave as zeroes + } + return sas; + } + if( family == AF_UNIX || port < 0 ) { + // UNIX path + saU->sun_family = AF_UNIX; + std::strncpy(saU->sun_path, addrstr.c_str(), + sizeof(saU->sun_path) - 1); + return sas; + } + if( family == AF_INET || family == AF_UNSPEC ) { + // Try IPv4 address + if( ::inet_pton(AF_INET, addrstr.c_str(), &(sa4->sin_addr)) == 1 ) { + sa4->sin_family = AF_INET; + sa4->sin_port = htons(port); + return sas; + } + } + if( family == AF_INET6 || family == AF_UNSPEC ) { + // Try IPv6 address + if( ::inet_pton(AF_INET6, addrstr.c_str(), &(sa6->sin6_addr)) == 1 ) { + sa6->sin6_family = AF_INET6; + sa6->sin6_port = htons(port); + return sas; + } + } + // Try interface lookup + if( Socket::addr_from_interface(addrstr.c_str(), (sockaddr*)&sas, family) ) { + // Note: Can actually be ip4 or ip6 but the port works the same + sa4->sin_port = htons(port); + return sas; + } + // Try hostname lookup + else if( Socket::addr_from_hostname(addrstr.c_str(), (sockaddr*)&sas, family) ) { + // Note: Can actually be ip4 or ip6 but the port works the same + sa4->sin_port = htons(port); + return sas; + } + else { + throw Socket::Error("Not a valid IP address, interface or hostname"); + } +} + +std::string Socket::address_string(sockaddr_storage const& addr) { + switch( addr.ss_family ) { + case AF_UNIX: { + // WAR for sun_path not always being NULL-terminated + // TODO: Fix this up! + /* + char addr0[sizeof(struct sockaddr_un)+1]; + memset(addr0, 0, sizeof(addr0)); + memcpy(addr0, &addr, sizeof(struct sockaddr_un)); + return std::string(((struct sockaddr_un*)addr0)->sun_path); + */ + return ""; + } + case AF_INET: + case AF_INET6: { + char buffer[INET6_ADDRSTRLEN]; + if( getnameinfo((struct sockaddr*)&addr, sizeof(addr), + buffer, sizeof(buffer), + 0, 0, NI_NUMERICHOST) != 0 ) { + return ""; + } + else { + return std::string(buffer); + } + } + default: throw Socket::Error("Invalid address family"); + } +} + +int Socket::discover_mtu(sockaddr_storage const& remote_address) { + Socket s(SOCK_DGRAM); + s.connect(remote_address); +#if defined __APPLE__ && __APPLE__ + return ::get_mtu(s.get_fd()); +#else + return s.get_option(IP_MTU, IPPROTO_IP); +#endif +} + +void Socket::bind(sockaddr_storage& local_address, + int max_conn_queue) { + if( _mode != Socket::MODE_CLOSED ) { + throw Socket::Error("Socket is already open"); + } + this->open(local_address.ss_family); + + // Allow binding multiple sockets to one port + // See here for more info: https://lwn.net/Articles/542629/ + // TODO: This must be done before calling ::bind, which is slightly + // awkward with how this method is set up, as the user has + // no way to do it themselves. However, doing it by default + // is probably not a bad idea anyway. +#ifdef SO_REUSEPORT + this->set_option(SO_REUSEPORT, 1); +#else +#warning "Kernel version does not support SO_REUSEPORT; multithreaded send/recv will not be possible" +#endif + + // Determine multicast status... + int multicast = 0; + if( local_address.ss_family == AF_INET ) { + sockaddr_in *sa4 = reinterpret_cast(&local_address); + if( ((sa4->sin_addr.s_addr & 0xFF) >= 224) \ + && ((sa4->sin_addr.s_addr & 0xFF) < 240) ) { + multicast = 1; + } + } + + // ... and work accordingly + if( !multicast ) { + // Normal address + check_error(::bind(_fd, (struct sockaddr*)&local_address, sizeof(struct sockaddr)), + "bind socket"); + if( _type == SOCK_STREAM ) { + check_error(::listen(_fd, max_conn_queue), + "set socket to listen"); + _mode = Socket::MODE_LISTENING; + } + else { + _mode = Socket::MODE_BOUND; + } + } else { + // Multicast address + // Setup the INADDR_ANY socket base to bind to + struct sockaddr_in base_address; + memset(&base_address, 0, sizeof(sockaddr_in)); + base_address.sin_family = reinterpret_cast(&local_address)->sin_family; + base_address.sin_addr.s_addr = htonl(INADDR_ANY); + base_address.sin_port = htons(reinterpret_cast(&local_address)->sin_port); + check_error(::bind(_fd, (struct sockaddr*)&local_address, sizeof(struct sockaddr)), + "bind socket"); + + if( _type == SOCK_STREAM ) { + throw Socket::Error("SOCK_STREAM is not supported with multicast receive"); + } else { + // Deal with joining the multicast group + struct ip_mreq mreq; + memset(&mreq, 0, sizeof(ip_mreq)); + mreq.imr_multiaddr.s_addr = reinterpret_cast(&local_address)->sin_addr.s_addr; + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + this->set_option(IP_ADD_MEMBERSHIP, mreq, IPPROTO_IP); + _mode = Socket::MODE_BOUND; + } + } +} + +void Socket::sniff(sockaddr_storage const& local_address, + int max_conn_queue) { + if( _mode != Socket::MODE_CLOSED ) { + throw Socket::Error("Socket is already open"); + } +#if defined __linux__ && __linux__ + this->open(AF_PACKET, htons(ETH_P_IP)); + + // Allow binding multiple sockets to one port + // See here for more info: https://lwn.net/Articles/542629/ + // TODO: This must be done before calling ::bind, which is slightly + // awkward with how this method is set up, as the user has + // no way to do it themselves. However, doing it by default + // is probably not a bad idea anyway. +#ifdef SO_REUSEPORT + this->set_option(SO_REUSEPORT, 1); +#else + #warning "Kernel version does not support SO_REUSEPORT; multithreaded send/recv will not be possible" +#endif + struct ifreq ethreq; + memset(ðreq, 0, sizeof(ethreq)); + + // Find out which interface this address corresponds to + this->interface_from_addr((struct sockaddr*)(&local_address), + ethreq.ifr_name, + local_address.ss_family); + check_error(::ioctl(_fd, SIOCGIFINDEX, ðreq), + "find sniff interface index"); + + // Bind to that interface + sockaddr_storage sas; + memset(&sas, 0, sizeof(sas)); + sockaddr_ll* sll = reinterpret_cast(&sas); + sll->sll_family = AF_PACKET; + sll->sll_ifindex = ethreq.ifr_ifindex; + sll->sll_protocol = htons(ETH_P_IP); + check_error(::bind(_fd, (struct sockaddr*)(&sas), sizeof(sas)), + "bind sniff socket"); + + // Final check to make sure we are golden + if( _type == SOCK_STREAM ) { + throw Socket::Error("SOCK_STREAM is not supported with packet sniffing"); + } else { + _mode = Socket::MODE_BOUND; + } + + // Make the socket promiscuous + this->set_promiscuous(true); +#else + #warning packet sniffing is not supported on this OS + check_error(-1, "unsupported on this OS"); +#endif +} + +// TODO: Add timeout support? Bit of a pain to implement. +void Socket::connect(sockaddr_storage const& remote_address) { + bool can_reuse = (_fd != -1 && + _type == SOCK_DGRAM && + (remote_address.ss_family == AF_UNSPEC || + remote_address.ss_family == _family)); + if( !can_reuse ) { + if( _mode != Socket::MODE_CLOSED ) { + throw Socket::Error("Socket is already open"); + } + this->open(remote_address.ss_family); + } + check_error(::connect(_fd, (sockaddr*)&remote_address, sizeof(sockaddr)), + "connect socket"); + if( remote_address.ss_family == AF_UNSPEC ) { + _mode = Socket::MODE_BOUND; + } + else { + _mode = Socket::MODE_CONNECTED; + } +} + +Socket* Socket::accept(double timeout_secs) { + if( _mode != Socket::MODE_LISTENING ) { + throw Socket::Error("Socket is not listening"); + } + sockaddr_storage remote_addr; + int flags = timeout_secs >= 0 ? SOCK_NONBLOCK : 0; + socklen_t addrsize = sizeof(remote_addr); + int ret = ::accept4(_fd, (sockaddr*)&remote_addr, &addrsize, flags); + if( ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { + pollfd pfd; + pfd.fd = _fd; + pfd.events = POLLIN | POLLERR | POLLRDNORM; + pfd.revents = 0; + int timeout_ms = int(std::min(timeout_secs*1e3, double(INT_MAX)) + 0.5); + if( poll(&pfd, 1, timeout_ms) == 0 ) { + // Timed out + return 0;//-1; + } + else { + ret = ::accept4(_fd, (sockaddr*)&remote_addr, &addrsize, flags); + if( ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { + // Connection dropped before accept completed + return 0;//-1; + } + else { + check_error(ret, "accept incoming connection"); + } + } + } + else { + check_error(ret, "accept incoming connection"); + } + //return ret; // File descriptor for new connected client socket + return Socket::manage(ret); +} + +void Socket::shutdown(int how) { + int ret = ::shutdown(_fd, how); + // WAR for shutdown() returning an error on unconnected DGRAM sockets, even + // though it still successfully unblocks recv calls in other threads, + // which is very useful behaviour. + // Note: In Python, the corresponding exception can be avoided by + // connecting the socket to ("0.0.0.0", 0) first. + if( ret < 0 && errno != EOPNOTSUPP && errno != ENOTCONN ) { + check_error(ret, "shutdown socket"); + } +} + +// Note: If offsets is NULL, assumes uniform spacing of sizes[0] +void Socket::prepare_msgs(size_t npacket, + void* header_buf, + size_t const* header_offsets, + size_t const* header_sizes, + void* payload_buf, + size_t const* payload_offsets, + size_t const* payload_sizes, + sockaddr_storage* packet_addrs) { + mmsghdr hdr0 = {}; + _msgs.resize(npacket, hdr0); + _iovecs.resize(npacket*2); + for( uint64_t m=0; m 0 ) { + timeval timeout; + timeout.tv_sec = (int)timeout_secs; + timeout.tv_usec = (int)((timeout_secs - timeout.tv_sec)*1e6); + setsockopt(_fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); + } + // TODO: Replacing MSG_WAITFORONE with 0 results in low CPU use instead of 100% + // Probably add an option to the function call + //int flags = (timeout_secs == 0) ? MSG_DONTWAIT : MSG_WAITFORONE; + int flags = (timeout_secs == 0) ? MSG_DONTWAIT : 0; + this->prepare_msgs(npacket, + header_buf, header_offsets, header_sizes, + payload_buf, payload_offsets, payload_sizes, + packet_sources); + ssize_t nmsg = recvmmsg(_fd, &_msgs[0], _msgs.size(), flags, 0);//timeout_ptr); + if( nmsg < 0 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { + nmsg = 0; + } + else { + check_error(nmsg, "receive messages"); + } + _nrecv_bytes = 0; + if( packet_sizes ) { + for( ssize_t m=0; mcmsg_type == SO_RXQ_OVFL ) { +unsigned* uptr = reinterpret_cast(CMSG_DATA(cmsg)); +_ndropped += *uptr; +break; +} +} +} + */ + return nmsg; +} + +size_t Socket::recv_packet(void* header_buf, + size_t header_size, + void* payload_buf, + size_t payload_size, + size_t* packet_size, + sockaddr_storage* packet_source, + double timeout_secs) { + return this->recv_block(1, + header_buf, 0, &header_size, + payload_buf, 0, &payload_size, + packet_size, + packet_source, + timeout_secs); +} + +size_t Socket::send_block(size_t npacket, + void const* header_buf, + size_t const* header_offsets, + size_t const* header_sizes, + void const* payload_buf, + size_t const* payload_offsets, + size_t const* payload_sizes, + sockaddr_storage const* packet_dests, // Not needed after connect() + double timeout_secs) { + if( !(_mode == Socket::MODE_BOUND || _mode == Socket::MODE_CONNECTED) ) { + throw Socket::Error("Cannot send; not connected or listening"); + } + if( packet_dests && _mode == Socket::MODE_CONNECTED ) { + throw Socket::Error("packet_dests must be NULL for connected sockets"); + } + else if( !packet_dests && _mode == Socket::MODE_BOUND ) { + throw Socket::Error("packet_dests must be specified for bound sockets"); + } + if( timeout_secs > 0 ) { + timeval timeout; + timeout.tv_sec = (int)timeout_secs; + timeout.tv_usec = (int)((timeout_secs - timeout.tv_sec)*1e6); + setsockopt(_fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); + } + int flags = (timeout_secs == 0) ? MSG_DONTWAIT : 0; + this->prepare_msgs(npacket, + (void*)header_buf, header_offsets, header_sizes, + (void*)payload_buf, payload_offsets, payload_sizes, + (sockaddr_storage*)packet_dests); + ssize_t nmsg = sendmmsg(_fd, &_msgs[0], _msgs.size(), flags); + if( nmsg < 0 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { + nmsg = 0; + } + else { + check_error(nmsg, "send messages"); + } + return nmsg; +} + +size_t Socket::send_packet(void const* header_buf, + size_t header_size, + void const* payload_buf, + size_t payload_size, + sockaddr_storage const* packet_dest, // Not needed after connect() + double timeout_secs) { + return this->send_block(1, + header_buf, 0, &header_size, + payload_buf, 0, &payload_size, + packet_dest, timeout_secs); +} + +void Socket::open(sa_family_t family, int protocol) { + this->close(); + _family = family; + check_error(_fd = ::socket(_family, _type, protocol), + "create socket"); + this->set_default_options(); +} + +void Socket::set_default_options() { + // Increase socket buffer sizes for efficiency + this->set_option(SO_RCVBUF, DEFAULT_SOCK_BUF_SIZE); + this->set_option(SO_SNDBUF, DEFAULT_SOCK_BUF_SIZE); + struct linger linger_obj; + linger_obj.l_onoff = 1; + linger_obj.l_linger = DEFAULT_LINGER_SECS; + this->set_option(SO_LINGER, linger_obj); + // TODO: Not sure if this feature actually works + //this->set_option(SO_RXQ_OVFL, 1); // Enable dropped packet logging +} + +sockaddr_storage Socket::get_remote_address() /*const*/ { + if( _mode != Socket::MODE_CONNECTED ) { + throw Socket::Error("Not connected"); + } + sockaddr_storage sas; + socklen_t size = sizeof(sas); + check_error(::getpeername(_fd, (sockaddr*)&sas, &size), + "get peer address"); + return sas; +} + +int Socket::get_mtu() /*const*/ { + if( _mode != Socket::MODE_CONNECTED ) { + throw Socket::Error("Not connected"); + } +#if defined __APPLE__ && __APPLE__ + return ::get_mtu(_fd); +#else + return this->get_option(IP_MTU, IPPROTO_IP); +#endif +} + +sockaddr_storage Socket::get_local_address() /*const*/ { + if( _mode != Socket::MODE_CONNECTED && + _mode != Socket::MODE_BOUND ) { + throw Socket::Error("Not bound"); + } + sockaddr_storage sas; + socklen_t size = sizeof(sas); + check_error(::getsockname(_fd, (sockaddr*)&sas, &size), + "get socket address"); + return sas; +} + +void Socket::close() { + if( _fd >= 0 ) { + try { + this->set_promiscuous(false); + } + catch( Socket::Error const& ) {} + ::close(_fd); + _fd = -1; + _family = AF_UNSPEC; + _mode = Socket::MODE_CLOSED; + } +} + +// Similar to pton(), copies first found address into *address and returns 1 +// on success, else 0. +int Socket::addr_from_hostname(const char* hostname, + sockaddr* address, + sa_family_t family, + int socktype) { + struct addrinfo hints; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = family; + hints.ai_socktype = socktype; + hints.ai_flags = 0; // Any + hints.ai_protocol = 0; // Any + struct addrinfo* servinfo; + if( ::getaddrinfo(hostname, 0, &hints, &servinfo) != 0 ) { + return 0; + } + for( struct addrinfo* it=servinfo; it!=NULL; it=it->ai_next ) { + ::memcpy(address, it->ai_addr, it->ai_addrlen); + break; // Return first address + } + ::freeaddrinfo(servinfo); + return 1; +} + +int Socket::addr_from_interface(const char* ifname, + sockaddr* address, + sa_family_t family) { + ifaddrs* ifaddr; + if( ::getifaddrs(&ifaddr) == -1 ) { + return 0; + } + bool found = false; + for( ifaddrs* ifa=ifaddr; ifa!=NULL; ifa=ifa->ifa_next ) { + if( std::strcmp(ifa->ifa_name, ifname) != 0 || + ifa->ifa_addr == NULL ) { + continue; + } + sa_family_t ifa_family = ifa->ifa_addr->sa_family; + if( (family == AF_UNSPEC && (ifa_family == AF_INET || + ifa_family == AF_INET6)) || + ifa_family == family ) { + size_t addr_size = ((ifa_family == AF_INET) ? + sizeof(struct sockaddr_in) : + sizeof(struct sockaddr_in6)); + ::memcpy(address, ifa->ifa_addr, addr_size); + found = true; + break; // Return first match + } + } + ::freeifaddrs(ifaddr); + return found; +} + +int Socket::interface_from_addr(sockaddr* address, + char* ifname, + sa_family_t family) { + ifaddrs* ifaddr; + if( ::getifaddrs(&ifaddr) == -1 ) { + return 0; + } + bool found = false; + for( ifaddrs* ifa=ifaddr; ifa!=NULL; ifa=ifa->ifa_next ) { + if( ifa->ifa_name == NULL || + ifa->ifa_addr == NULL ) { + continue; + } + sa_family_t ifa_family = ifa->ifa_addr->sa_family; + if( (family == AF_UNSPEC && (ifa_family == AF_INET \ + || ifa_family == AF_INET6) \ + ) || ifa_family == family ) { + switch(ifa_family) { + case AF_INET: { + struct sockaddr_in* inaddr = (struct sockaddr_in*) ifa->ifa_addr; + struct sockaddr_in* inmask = (struct sockaddr_in*) ifa->ifa_netmask; + sockaddr_in* sa4 = reinterpret_cast(address); + + if( (inaddr->sin_addr.s_addr & inmask->sin_addr.s_addr) \ + == (sa4->sin_addr.s_addr & inmask->sin_addr.s_addr) ) { + found = true; + } + break; + } + case AF_INET6: { + struct sockaddr_in6* inaddr6 = (struct sockaddr_in6*) ifa->ifa_addr; + struct sockaddr_in6* inmask6 = (struct sockaddr_in6*) ifa->ifa_netmask; + sockaddr_in6* sa6 = reinterpret_cast(address); + + uint64_t lowerIA=0, upperIA=0, lowerIM=0, upperIM=0; + uint64_t lowerAA=0, upperAA=0; + for(int i=0; i<8; i++) { + lowerIA |= inaddr6->sin6_addr.s6_addr[i] << (8*i); + upperIA |= inaddr6->sin6_addr.s6_addr[8+i] << (8*i); + lowerIM |= inmask6->sin6_addr.s6_addr[i] << (8*i); + upperIM |= inmask6->sin6_addr.s6_addr[8+i] << (8*i); + + lowerAA |= sa6->sin6_addr.s6_addr[i] << (8*i); + upperAA |= sa6->sin6_addr.s6_addr[8+i] << (8*i); + } + + if( ((lowerIA & lowerIM) == (lowerAA & lowerIM)) \ + && ((upperIA & upperIM) == (upperAA & upperIM)) ) { + found = true; + } + break; + } + default: break; + } + if( found ) { + std::strcpy(ifname, ifa->ifa_name); + break; // Return first match + } + } + } + ::freeifaddrs(ifaddr); + return found; +} + +void Socket::set_promiscuous(int state) { +#if defined __linux__ && __linux__ + sockaddr_storage addr = this->get_local_address(); + + struct ifreq ethreq; + memset(ðreq, 0, sizeof(ethreq)); + if( ((sockaddr*)(&addr))->sa_family == AF_PACKET ) { + sockaddr_ll* sll = reinterpret_cast(&addr); + ethreq.ifr_ifindex = sll->sll_ifindex; + check_error(::ioctl(_fd, SIOCGIFNAME, ðreq), + "find interface name"); + } else { + this->interface_from_addr((sockaddr*)&addr, ethreq.ifr_name, _family); + } + + check_error(ioctl(_fd, SIOCGIFFLAGS, ðreq), + "read interface setup"); + if( state && (ethreq.ifr_flags & IFF_PROMISC) ) { + // Oh good, it's already done + } else if ( state && !(ethreq.ifr_flags & IFF_PROMISC) ) { + ethreq.ifr_flags |= IFF_PROMISC; + check_error(ioctl(_fd, SIOCSIFFLAGS, ðreq), + "change interface setup"); + } else if ( !state && (ethreq.ifr_flags & IFF_PROMISC) ){ + ethreq.ifr_flags ^= IFF_PROMISC; + check_error(ioctl(_fd, SIOCSIFFLAGS, ðreq), + "change interface setup"); + } +#else + #warning promiscuous network interfaces are not supported on this OS + check_error(-1, "unsupported on this OS"); +#endif +} + +int Socket::get_promiscuous() { +#if defined __linux__ && __linux__ + sockaddr_storage addr = this->get_local_address(); + + struct ifreq ethreq; + memset(ðreq, 0, sizeof(ethreq)); + if( ((sockaddr*)(&addr))->sa_family == AF_PACKET ) { + sockaddr_ll* sll = reinterpret_cast(&addr); + ethreq.ifr_ifindex = sll->sll_ifindex; + check_error(::ioctl(_fd, SIOCGIFNAME, ðreq), + "find interface name"); + } else { + this->interface_from_addr((sockaddr*)&addr, ethreq.ifr_name, _family); + } + + check_error(ioctl(_fd, SIOCGIFFLAGS, ðreq), + "read interface setup"); + if( ethreq.ifr_flags & IFF_PROMISC ) { + return true; + } else { + return false; + } +#else + #warning promiscuous network interfaces are not supported on this OS + check_error(-1, "unsupported on this OS"); + return false; +#endif +} + +void Socket::replace(Socket& s) { + _fd = s._fd; s._fd = -1; + _type = std::move(s._type); + _family = std::move(s._family); + _mode = std::move(s._mode); + _ndropped = std::move(s._ndropped); + _nrecv_bytes = std::move(s._nrecv_bytes); + _msgs = std::move(s._msgs); + _iovecs = std::move(s._iovecs); +} + +void Socket::swap(Socket& s) { + std::swap(_fd, s._fd); + std::swap(_type, s._type); + std::swap(_family, s._family); + std::swap(_mode, s._mode); + std::swap(_ndropped, s._ndropped); + std::swap(_nrecv_bytes, s._nrecv_bytes); + std::swap(_msgs, s._msgs); + std::swap(_iovecs, s._iovecs); +} + +Socket::Socket(int fd, ManageTag ) : _fd(fd) { + _type = this->get_option(SO_TYPE); +#if defined __APPLE__ && __APPLE__ + _family = get_family(fd); +#else + _family = this->get_option(SO_DOMAIN); +#endif + if( this->get_option(SO_ACCEPTCONN) ) { + _mode = Socket::MODE_LISTENING; + } + else { + // Not listening + try { + _mode = Socket::MODE_CONNECTED; + this->get_remote_address(); + } + catch( Socket::Error const& ) { + // Not connected + try { + _mode = Socket::MODE_BOUND; + this->get_local_address(); + } + catch( Socket::Error const& ) { + // Not bound + _mode = Socket::MODE_CLOSED; + } + } + } + this->set_default_options(); +} diff --git a/src/Socket.hpp b/src/Socket.hpp index da145e898..9f08051c8 100644 --- a/src/Socket.hpp +++ b/src/Socket.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -124,19 +124,49 @@ client.send/recv_block/packet(...); #include #include #include + +#if defined __linux__ && __linux__ + //#include +#include +#include + +#endif + + +#if defined __APPLE__ && __APPLE__ + +#include +#include +#include + +#define SOCK_NONBLOCK O_NONBLOCK + +typedef struct mmsghdr { + struct msghdr msg_hdr; /* Message header */ + unsigned int msg_len; /* Number of bytes transmitted */ +} mmsghdr; + +int recvmmsg(int sockfd, + struct mmsghdr *msgvec, + unsigned int vlen, + int flags, + struct timespec *timeout); +int sendmmsg(int sockfd, + struct mmsghdr *msgvec, + unsigned int vlen, + int flags); +#endif // __APPLE__ class Socket { // Not copy-assignable Socket(Socket const& ); Socket& operator=(Socket const& ); -#if __cplusplus >= 201103L - inline void replace(Socket& s); -#endif + void replace(Socket& s); // Manage an existing socket descriptor // Note: Accessible only via the named constructor Socket::manage struct ManageTag {}; - inline Socket(int fd, ManageTag ); + Socket(int fd, ManageTag ); public: // TODO: Move this definition below class Error : public std::runtime_error { @@ -150,59 +180,64 @@ class Socket { : super_t(what_arg) {} }; enum { +#if defined __APPLE__ && __APPLE__ + DEFAULT_SOCK_BUF_SIZE = 4*1024*1024, + DEFAULT_LINGER_SECS = 1, +#else DEFAULT_SOCK_BUF_SIZE = 256*1024*1024, DEFAULT_LINGER_SECS = 3, +#endif DEFAULT_MAX_CONN_QUEUE = 128 }; - enum sock_type { - SOCK_DGRAM = ::SOCK_DGRAM, - SOCK_STREAM = ::SOCK_STREAM - }; // Manage an existing socket (usually one returned by Socket::accept()) // TODO: With C++11 this could return by value (moved), which would be nicer - inline static Socket* manage(int fd) { return new Socket(fd, ManageTag()); } - inline explicit Socket(/*sock_type*/int type=SOCK_DGRAM) - : _fd(-1), _type((sock_type)type), _family(AF_UNSPEC), - _mode(Socket::MODE_CLOSED) {} + static Socket* manage(int fd) { return new Socket(fd, ManageTag()); } + explicit Socket(int type=SOCK_DGRAM) + : _fd(-1), _type(type), _family(AF_UNSPEC), + _mode(Socket::MODE_CLOSED) { + if( !(type == SOCK_DGRAM || type == SOCK_STREAM) ) { + throw Socket::Error("Invalid socket type"); + } + } virtual ~Socket() { this->close(); } -#if __cplusplus >= 201103L // Move semantics - inline Socket(Socket&& s) { this->replace(s); } - inline Socket& operator=(Socket&& s) { this->close(); this->replace(s); return *this; } -#endif - inline void swap(Socket& s); + Socket(Socket&& s) { this->replace(s); } + Socket& operator=(Socket&& s) { this->close(); this->replace(s); return *this; } + void swap(Socket& s); // Address generator // Note: Supports UNIX paths, IPv4 and IPv6 addrs, interfaces and hostnames // Passing addr=0 means "any address" // Passing port=-1 implies family=AF_UNIX - inline static sockaddr_storage address(std::string addr, + static sockaddr_storage address(std::string addr, // Note: int so that -1 can be given int port, sa_family_t family=AF_UNSPEC); - inline static sockaddr_storage any_address(sa_family_t family=AF_UNSPEC); - inline static std::string address_string(sockaddr_storage addr); - inline static int discover_mtu(sockaddr_storage remote_address); + static sockaddr_storage any_address(sa_family_t family=AF_UNSPEC); + static std::string address_string(sockaddr_storage const& addr); + static int discover_mtu(sockaddr_storage const& remote_address); // Server initialisation - inline void bind(sockaddr_storage local_address, + void bind(sockaddr_storage& local_address, + int max_conn_queue=DEFAULT_MAX_CONN_QUEUE); + void sniff(sockaddr_storage const& local_address, int max_conn_queue=DEFAULT_MAX_CONN_QUEUE); // Client initialisation - inline void connect(sockaddr_storage remote_address); + void connect(sockaddr_storage const& remote_address); // Accept incoming SOCK_STREAM connection requests // TODO: With C++11 this could return by value (moved), which would be nicer - inline Socket* accept(double timeout_secs=-1); + Socket* accept(double timeout_secs=-1); // Note: This can be used to unblock recv calls from another thread // This behaviour is not explicitly documented, but it works, is // much simpler than having to mess around with select/poll, and // is better than relying on timeouts. // IMHO this should be official behaviour of POSIX shutdown! - inline void shutdown(int how=SHUT_RD); + void shutdown(int how=SHUT_RD); //void shutdown(int how=SHUT_RDWR); - inline void close(); + void close(); // Send/receive // Note: These four methods return the number of packets received/sent - inline size_t recv_block(size_t npacket, // Max for UDP + size_t recv_block(size_t npacket, // Max for UDP void* header_buf, // Can be NULL size_t const* header_offsets, size_t const* header_sizes, @@ -212,7 +247,7 @@ class Socket { size_t* packet_sizes, sockaddr_storage* packet_sources=0, double timeout_secs=-1); - inline size_t recv_packet(void* header_buf, + size_t recv_packet(void* header_buf, size_t header_size, void* payload_buf, size_t payload_size, @@ -220,11 +255,11 @@ class Socket { sockaddr_storage* packet_source=0, double timeout_secs=-1); // No. dropped packets detected during last call to recv_* - inline size_t get_drop_count() const { return _ndropped; } + size_t get_drop_count() const { return _ndropped; } // No. bytes received by last call to recv_* // Note: Only valid if packet_sizes was non-NULL, otherwise returns 0 - inline size_t get_recv_size() const { return _nrecv_bytes; } - inline size_t send_block(size_t npacket, + size_t get_recv_size() const { return _nrecv_bytes; } + size_t send_block(size_t npacket, void const* header_buf, size_t const* header_offsets, size_t const* header_sizes, @@ -233,37 +268,32 @@ class Socket { size_t const* payload_sizes, sockaddr_storage const* packet_dests=0, // Not needed after connect() double timeout_secs=-1); - inline size_t send_packet(void const* header_buf, + size_t send_packet(void const* header_buf, size_t header_size, void const* payload_buf, size_t payload_size, sockaddr_storage const* packet_dest=0, // Not needed after connect() double timeout_secs=-1); - inline sockaddr_storage get_local_address() /*const*/; // check_error is non-const - inline sockaddr_storage get_remote_address() /*const*/; - inline int get_mtu() /*const*/ { - if( _mode != Socket::MODE_CONNECTED ) { - throw Socket::Error("Not connected"); - } - return this->get_option(IP_MTU, IPPROTO_IP); - } + sockaddr_storage get_local_address() /*const*/; // check_error is non-const + sockaddr_storage get_remote_address() /*const*/; + int get_mtu() /*const*/; template - inline void set_option(int optname, T value, int level=SOL_SOCKET) { + void set_option(int optname, T value, int level=SOL_SOCKET) { //::setsockopt(_fd, level, optname, &value, sizeof(value)); check_error( ::setsockopt(_fd, level, optname, &value, sizeof(value)), "set socket option" ); } // Note: non-const because check_error closes the socket on failure template - inline T get_option(int optname, int level=SOL_SOCKET) /*const*/ { + T get_option(int optname, int level=SOL_SOCKET) /*const*/ { T value; socklen_t size = sizeof(value); check_error( ::getsockopt(_fd, level, optname, &value, &size), "get socket option"); return value; } - inline int get_fd() const { return _fd; } - inline void set_timeout(double secs) { + int get_fd() const { return _fd; } + void set_timeout(double secs) { if( secs > 0 ) { timeval timeout; timeout.tv_sec = (int)secs; @@ -272,17 +302,20 @@ class Socket { this->set_option(SO_SNDTIMEO, timeout); } } - inline double get_timeout() const { + double get_timeout() const { // WAR for non-const get_option (which is because of close-on-error) Socket* self = const_cast(this); // TODO: This ignores SO_SNDTIMEO timeval timeout = self->get_option(SO_RCVTIMEO); return timeout.tv_sec + timeout.tv_usec*1e-6; } + void set_promiscuous(int state); + int get_promiscuous(); + private: - inline void open(sa_family_t family); - inline void set_default_options(); - inline void check_error(int retval, std::string what) { + void open(sa_family_t family, int protocol=0); + void set_default_options(); + void check_error(int retval, std::string what) { if( retval < 0 ) { if( errno == ENOTCONN ) { this->close(); @@ -293,7 +326,7 @@ class Socket { throw Socket::Error(ss.str()); } } - inline void prepare_msgs(size_t npacket, + void prepare_msgs(size_t npacket, void* header_buf, size_t const* header_offsets, size_t const* header_sizes, @@ -301,15 +334,19 @@ class Socket { size_t const* payload_offsets, size_t const* payload_sizes, sockaddr_storage* packet_addrs); - inline static int addr_from_hostname(const char* hostname, + static int addr_from_hostname(const char* hostname, sockaddr* address, sa_family_t family=AF_UNSPEC, int socktype=0); - inline static int addr_from_interface(const char* ifname, + static int addr_from_interface(const char* ifname, sockaddr* address, sa_family_t family=AF_UNSPEC); + static int interface_from_addr(sockaddr* address, + char* ifname, + sa_family_t family=AF_UNSPEC); + int _fd; - sock_type _type; + int _type; sa_family_t _family; enum { MODE_CLOSED, @@ -324,523 +361,3 @@ class Socket { std::vector _msgs; std::vector _iovecs; }; - -sockaddr_storage Socket::any_address(sa_family_t family) { - //return Socket::address(0, -1, family); - return Socket::address("", 0, family); -} -sockaddr_storage Socket::address(//const char* addrstr, - std::string addrstr, - int port, - sa_family_t family) { - sockaddr_storage sas; - memset(&sas, 0, sizeof(sas)); - sockaddr_in* sa4 = reinterpret_cast (&sas); - sockaddr_in6* sa6 = reinterpret_cast(&sas); - sockaddr_un* saU = reinterpret_cast (&sas); - //if( !addrstr || !std::strlen(addrstr) ) { - if( addrstr.empty() ) { - // No address means "any address" - sas.ss_family = family; - switch( family ) { - case AF_INET: { - sa4->sin_addr.s_addr = htonl(INADDR_ANY); - sa4->sin_port = htons(port); - break; - } - case AF_INET6: { - ::memcpy(&sa6->sin6_addr, &in6addr_any, sizeof(in6addr_any)); - sa4->sin_port = htons(port); - break; - } - case AF_UNIX: // Fall-through - case AF_UNSPEC: // Fall-through - default: break; // Leave as zeroes - } - return sas; - } - if( family == AF_UNIX || port < 0 ) { - // UNIX path - saU->sun_family = AF_UNIX; - std::strncpy(saU->sun_path, addrstr.c_str(), - sizeof(saU->sun_path) - 1); - return sas; - } - if( family == AF_INET || family == AF_UNSPEC ) { - // Try IPv4 address - if( ::inet_pton(AF_INET, addrstr.c_str(), &(sa4->sin_addr)) == 1 ) { - sa4->sin_family = AF_INET; - sa4->sin_port = htons(port); - return sas; - } - } - if( family == AF_INET6 || family == AF_UNSPEC ) { - // Try IPv6 address - if( ::inet_pton(AF_INET6, addrstr.c_str(), &(sa6->sin6_addr)) == 1 ) { - sa6->sin6_family = AF_INET6; - sa6->sin6_port = htons(port); - return sas; - } - } - // Try interface lookup - if( Socket::addr_from_interface(addrstr.c_str(), (sockaddr*)&sas, family) ) { - // Note: Can actually be ip4 or ip6 but the port works the same - sa4->sin_port = htons(port); - return sas; - } - // Try hostname lookup - else if( Socket::addr_from_hostname(addrstr.c_str(), (sockaddr*)&sas, family) ) { - // Note: Can actually be ip4 or ip6 but the port works the same - sa4->sin_port = htons(port); - return sas; - } - else { - throw Socket::Error("Not a valid IP address, interface or hostname"); - } -} -std::string Socket::address_string(sockaddr_storage addr) { - switch( addr.ss_family ) { - case AF_UNIX: { - // WAR for sun_path not always being NULL-terminated - // TODO: Fix this up! - /* - char addr0[sizeof(struct sockaddr_un)+1]; - memset(addr0, 0, sizeof(addr0)); - memcpy(addr0, &addr, sizeof(struct sockaddr_un)); - return std::string(((struct sockaddr_un*)addr0)->sun_path); - */ - return ""; - } - case AF_INET: - case AF_INET6: { - char buffer[INET6_ADDRSTRLEN]; - if( getnameinfo((struct sockaddr*)&addr, sizeof(addr), - buffer, sizeof(buffer), - 0, 0, NI_NUMERICHOST) != 0 ) { - return ""; - } - else { - return std::string(buffer); - } - } - default: throw Socket::Error("Invalid address family"); - } -} -int Socket::discover_mtu(sockaddr_storage remote_address) { - Socket s(SOCK_DGRAM); - s.connect(remote_address); - return s.get_option(IP_MTU, IPPROTO_IP); -} -void Socket::bind(sockaddr_storage local_address, - int max_conn_queue) { - if( _mode != Socket::MODE_CLOSED ) { - throw Socket::Error("Socket is already open"); - } - this->open(local_address.ss_family); - - // Allow binding multiple sockets to one port - // See here for more info: https://lwn.net/Articles/542629/ - // TODO: This must be done before calling ::bind, which is slightly - // awkward with how this method is set up, as the user has - // no way to do it themselves. However, doing it by default - // is probably not a bad idea anyway. -#ifdef SO_REUSEPORT - this->set_option(SO_REUSEPORT, 1); -#else - #warning "Kernel version does not support SO_REUSEPORT; multithreaded send/recv will not be possible" -#endif - - check_error(::bind(_fd, (struct sockaddr*)&local_address, sizeof(local_address)), - "bind socket"); - if( _type == SOCK_STREAM ) { - check_error(::listen(_fd, max_conn_queue), - "set socket to listen"); - _mode = Socket::MODE_LISTENING; - } - else { - _mode = Socket::MODE_BOUND; - } -} -// TODO: Add timeout support? Bit of a pain to implement. -void Socket::connect(sockaddr_storage remote_address) { - bool can_reuse = (_fd != -1 && - _type == SOCK_DGRAM && - (remote_address.ss_family == AF_UNSPEC || - remote_address.ss_family == _family)); - if( !can_reuse ) { - if( _mode != Socket::MODE_CLOSED ) { - throw Socket::Error("Socket is already open"); - } - this->open(remote_address.ss_family); - } - check_error(::connect(_fd, (sockaddr*)&remote_address, sizeof(remote_address)), - "connect socket"); - if( remote_address.ss_family == AF_UNSPEC ) { - _mode = Socket::MODE_BOUND; - } - else { - _mode = Socket::MODE_CONNECTED; - } -} -Socket* Socket::accept(double timeout_secs) { - if( _mode != Socket::MODE_LISTENING ) { - throw Socket::Error("Socket is not listening"); - } - sockaddr_storage remote_addr; - int flags = timeout_secs >= 0 ? SOCK_NONBLOCK : 0; - socklen_t addrsize = sizeof(remote_addr); - int ret = ::accept4(_fd, (sockaddr*)&remote_addr, &addrsize, flags); - if( ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { - pollfd pfd; - pfd.fd = _fd; - pfd.events = POLLIN | POLLERR | POLLRDNORM; - pfd.revents = 0; - int timeout_ms = int(std::min(timeout_secs*1e3, double(INT_MAX)) + 0.5); - if( poll(&pfd, 1, timeout_ms) == 0 ) { - // Timed out - return 0;//-1; - } - else { - ret = ::accept4(_fd, (sockaddr*)&remote_addr, &addrsize, flags); - if( ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { - // Connection dropped before accept completed - return 0;//-1; - } - else { - check_error(ret, "accept incoming connection"); - } - } - } - else { - check_error(ret, "accept incoming connection"); - } - //return ret; // File descriptor for new connected client socket - return Socket::manage(ret); -} -void Socket::shutdown(int how) { - int ret = ::shutdown(_fd, how); - // WAR for shutdown() returning an error on unconnected DGRAM sockets, even - // though it still successfully unblocks recv calls in other threads, - // which is very useful behaviour. - // Note: In Python, the corresponding exception can be avoided by - // connecting the socket to ("0.0.0.0", 0) first. - if( ret < 0 && errno != EOPNOTSUPP && errno != ENOTCONN ) { - check_error(ret, "shutdown socket"); - } -} -// Note: If offsets is NULL, assumes uniform spacing of sizes[0] -void Socket::prepare_msgs(size_t npacket, - void* header_buf, - size_t const* header_offsets, - size_t const* header_sizes, - void* payload_buf, - size_t const* payload_offsets, - size_t const* payload_sizes, - sockaddr_storage* packet_addrs) { - mmsghdr hdr0 = {}; - _msgs.resize(npacket, hdr0); - _iovecs.resize(npacket*2); - for( uint64_t m=0; m 0 ) { - timeval timeout; - timeout.tv_sec = (int)timeout_secs; - timeout.tv_usec = (int)((timeout_secs - timeout.tv_sec)*1e6); - setsockopt(_fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); - } - // TODO: Replacing MSG_WAITFORONE with 0 results in low CPU use instead of 100% - // Probably add an option to the function call - //int flags = (timeout_secs == 0) ? MSG_DONTWAIT : MSG_WAITFORONE; - int flags = (timeout_secs == 0) ? MSG_DONTWAIT : 0; - this->prepare_msgs(npacket, - header_buf, header_offsets, header_sizes, - payload_buf, payload_offsets, payload_sizes, - packet_sources); - ssize_t nmsg = recvmmsg(_fd, &_msgs[0], _msgs.size(), flags, 0);//timeout_ptr); - if( nmsg < 0 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { - nmsg = 0; - } - else { - check_error(nmsg, "receive messages"); - } - _nrecv_bytes = 0; - if( packet_sizes ) { - for( ssize_t m=0; mcmsg_type == SO_RXQ_OVFL ) { - unsigned* uptr = reinterpret_cast(CMSG_DATA(cmsg)); - _ndropped += *uptr; - break; - } - } - } - */ - return nmsg; -} -size_t Socket::recv_packet(void* header_buf, - size_t header_size, - void* payload_buf, - size_t payload_size, - size_t* packet_size, - sockaddr_storage* packet_source, - double timeout_secs) { - return this->recv_block(1, - header_buf, 0, &header_size, - payload_buf, 0, &payload_size, - packet_size, - packet_source, - timeout_secs); -} -size_t Socket::send_block(size_t npacket, - void const* header_buf, - size_t const* header_offsets, - size_t const* header_sizes, - void const* payload_buf, - size_t const* payload_offsets, - size_t const* payload_sizes, - sockaddr_storage const* packet_dests, // Not needed after connect() - double timeout_secs) { - if( !(_mode == Socket::MODE_BOUND || _mode == Socket::MODE_CONNECTED) ) { - throw Socket::Error("Cannot send; not connected or listening"); - } - if( packet_dests && _mode == Socket::MODE_CONNECTED ) { - throw Socket::Error("packet_dests must be NULL for connected sockets"); - } - else if( !packet_dests && _mode == Socket::MODE_BOUND ) { - throw Socket::Error("packet_dests must be specified for bound sockets"); - } - if( timeout_secs > 0 ) { - timeval timeout; - timeout.tv_sec = (int)timeout_secs; - timeout.tv_usec = (int)((timeout_secs - timeout.tv_sec)*1e6); - setsockopt(_fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); - } - int flags = (timeout_secs == 0) ? MSG_DONTWAIT : 0; - this->prepare_msgs(npacket, - (void*)header_buf, header_offsets, header_sizes, - (void*)payload_buf, payload_offsets, payload_sizes, - (sockaddr_storage*)packet_dests); - ssize_t nmsg = sendmmsg(_fd, &_msgs[0], _msgs.size(), flags); - if( nmsg < 0 && (errno == EAGAIN || errno == EWOULDBLOCK ) ) { - nmsg = 0; - } - else { - check_error(nmsg, "send messages"); - } - return nmsg; -} -size_t Socket::send_packet(void const* header_buf, - size_t header_size, - void const* payload_buf, - size_t payload_size, - sockaddr_storage const* packet_dest, // Not needed after connect() - double timeout_secs) { - return this->send_block(1, - header_buf, 0, &header_size, - payload_buf, 0, &payload_size, - packet_dest, timeout_secs); -} -void Socket::open(sa_family_t family) { - this->close(); - _family = family; - check_error(_fd = ::socket(_family, _type, 0), - "create socket"); - this->set_default_options(); -} -void Socket::set_default_options() { - // Increase socket buffer sizes for efficiency - this->set_option(SO_RCVBUF, DEFAULT_SOCK_BUF_SIZE); - this->set_option(SO_SNDBUF, DEFAULT_SOCK_BUF_SIZE); - struct linger linger_obj; - linger_obj.l_onoff = 1; - linger_obj.l_linger = DEFAULT_LINGER_SECS; - this->set_option(SO_LINGER, linger_obj); - // TODO: Not sure if this feature actually works - //this->set_option(SO_RXQ_OVFL, 1); // Enable dropped packet logging -} -sockaddr_storage Socket::get_remote_address() /*const*/ { - if( _mode != Socket::MODE_CONNECTED ) { - throw Socket::Error("Not connected"); - } - sockaddr_storage sas; - socklen_t size = sizeof(sas); - check_error(::getpeername(_fd, (sockaddr*)&sas, &size), - "get peer address"); - return sas; -} -sockaddr_storage Socket::get_local_address() /*const*/ { - if( _mode != Socket::MODE_CONNECTED && - _mode != Socket::MODE_BOUND ) { - throw Socket::Error("Not bound"); - } - sockaddr_storage sas; - socklen_t size = sizeof(sas); - check_error(::getsockname(_fd, (sockaddr*)&sas, &size), - "get socket address"); - return sas; -} -void Socket::close() { - if( _fd >= 0 ) { - ::close(_fd); - _fd = -1; - _family = AF_UNSPEC; - _mode = Socket::MODE_CLOSED; - } -} -// Similar to pton(), copies first found address into *address and returns 1 -// on success, else 0. -int Socket::addr_from_hostname(const char* hostname, - sockaddr* address, - sa_family_t family, - int socktype) { - struct addrinfo hints; - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = family; - hints.ai_socktype = socktype; - hints.ai_flags = 0; // Any - hints.ai_protocol = 0; // Any - struct addrinfo* servinfo; - if( ::getaddrinfo(hostname, 0, &hints, &servinfo) != 0 ) { - return 0; - } - for( struct addrinfo* it=servinfo; it!=NULL; it=it->ai_next ) { - ::memcpy(address, it->ai_addr, it->ai_addrlen); - break; // Return first address - } - ::freeaddrinfo(servinfo); - return 1; -} -int Socket::addr_from_interface(const char* ifname, - sockaddr* address, - sa_family_t family) { - ifaddrs* ifaddr; - if( ::getifaddrs(&ifaddr) == -1 ) { - return 0; - } - bool found = false; - for( ifaddrs* ifa=ifaddr; ifa!=NULL; ifa=ifa->ifa_next ) { - if( std::strcmp(ifa->ifa_name, ifname) != 0 || - ifa->ifa_addr == NULL ) { - continue; - } - sa_family_t ifa_family = ifa->ifa_addr->sa_family; - if( (family == AF_UNSPEC && (ifa_family == AF_INET || - ifa_family == AF_INET6)) || - ifa_family == family ) { - size_t addr_size = ((ifa_family == AF_INET) ? - sizeof(struct sockaddr_in) : - sizeof(struct sockaddr_in6)); - ::memcpy(address, ifa->ifa_addr, addr_size); - found = true; - break; // Return first match - } - } - ::freeifaddrs(ifaddr); - return found; -} -#if __cplusplus >= 201103L -void Socket::replace(Socket& s) { - _fd = s._fd; s._fd = -1; - _type = std::move(s._type); - _family = std::move(s._family); - _mode = std::move(s._mode); - _ndropped = std::move(s._ndropped); - _nrecv_bytes = std::move(s._nrecv_bytes); - _msgs = std::move(s._msgs); - _iovecs = std::move(s._iovecs); -} -#endif -void Socket::swap(Socket& s) { - std::swap(_fd, s._fd); - std::swap(_type, s._type); - std::swap(_family, s._family); - std::swap(_mode, s._mode); - std::swap(_ndropped, s._ndropped); - std::swap(_nrecv_bytes, s._nrecv_bytes); - std::swap(_msgs, s._msgs); - std::swap(_iovecs, s._iovecs); -} -Socket::Socket(int fd, ManageTag ) : _fd(fd) { - _type = this->get_option(SO_TYPE); - _family = this->get_option(SO_DOMAIN); - if( this->get_option(SO_ACCEPTCONN) ) { - _mode = Socket::MODE_LISTENING; - } - else { - // Not listening - try { - _mode = Socket::MODE_CONNECTED; - this->get_remote_address(); - } - catch( Socket::Error const& ) { - // Not connected - try { - _mode = Socket::MODE_BOUND; - this->get_local_address(); - } - catch( Socket::Error const& ) { - // Not bound - _mode = Socket::MODE_CLOSED; - } - } - } - this->set_default_options(); -} diff --git a/src/Vector.hpp b/src/Vector.hpp index 3d4e586f7..446cd04ea 100644 --- a/src/Vector.hpp +++ b/src/Vector.hpp @@ -28,21 +28,6 @@ #pragma once -#if defined __CUDACC_VER_MAJOR__ && __CUDACC_VER_MAJOR__ < 9 - -#define COUNT_TRAILING_ZEROS(x) \ - (32 \ - - 1 * bool((unsigned(x) & unsigned(-signed(x))) & 0xFFFFFFFF) \ - - 16 * bool((unsigned(x) & unsigned(-signed(x))) & 0x0000FFFF) \ - - 8 * bool((unsigned(x) & unsigned(-signed(x))) & 0x00FF00FF) \ - - 4 * bool((unsigned(x) & unsigned(-signed(x))) & 0x0F0F0F0F) \ - - 2 * bool((unsigned(x) & unsigned(-signed(x))) & 0x33333333) \ - - 1 * bool((unsigned(x) & unsigned(-signed(x))) & 0x55555555)) -#define LARGEST_POW2_FACTOR(x) \ - (1 << COUNT_TRAILING_ZEROS(x)) - -#else // CUDA 9+ - template struct CountTrailingZeros { enum { @@ -62,8 +47,6 @@ struct LargestPow2Factor { }; #define LARGEST_POW2_FACTOR(x) LargestPow2Factor::value -#endif - template class __attribute__((aligned( LARGEST_POW2_FACTOR(sizeof(T)*N) ))) Vector { T _v[N]; diff --git a/src/address.cpp b/src/address.cpp index 7026ecdc1..52366623d 100644 --- a/src/address.cpp +++ b/src/address.cpp @@ -61,6 +61,24 @@ BFstatus bfAddressGetPort(BFaddress addr, int* port) { BF_TRY_RETURN_ELSE(*port = ntohs(((sockaddr_in*)addr)->sin_port), *port = 0); } +BFstatus bfAddressIsMulticast(BFaddress addr, int* multicast) { + BF_ASSERT(addr, BF_STATUS_INVALID_HANDLE); + BF_ASSERT(multicast, BF_STATUS_INVALID_POINTER); + + unsigned family; + bfAddressGetFamily(addr, &family); + + if( family == AF_INET ) { + sockaddr_in *sa4 = reinterpret_cast(addr); + if( ((sa4->sin_addr.s_addr & 0xFF) >= 224) \ + && ((sa4->sin_addr.s_addr & 0xFF) < 240) ) { + *multicast = 1; + } + } else { + *multicast = 0; + } + return BF_STATUS_SUCCESS; +} BFstatus bfAddressGetMTU(BFaddress addr, int* mtu) { BF_ASSERT(addr, BF_STATUS_INVALID_HANDLE); BF_ASSERT(mtu, BF_STATUS_INVALID_POINTER); diff --git a/src/affinity.cpp b/src/affinity.cpp index 36030c486..daf6f064d 100644 --- a/src/affinity.cpp +++ b/src/affinity.cpp @@ -27,19 +27,89 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include "assert.hpp" +#if BF_OPENMP_ENABLED #include +#endif #include //#include #include #include +#if defined __APPLE__ && __APPLE__ + +// Based on information from: +// http://www.hybridkernel.com/2015/01/18/binding_threads_to_cores_osx.html + +#include +#include +#include +#include +#include + +typedef struct cpu_set { + uint32_t count; +} cpu_set_t; + +static inline void +CPU_ZERO(cpu_set_t *cs) { cs->count = 0; } + +static inline void +CPU_SET(int num, cpu_set_t *cs) { cs->count |= (1 << num); } + +static inline int +CPU_ISSET(int num, cpu_set_t *cs) { return (cs->count & (1 << num)); } + +static inline int +CPU_COUNT(cpu_set_t *cs) { + int count = 0; + for(int i=0; i<8*sizeof(cpu_set_t); i++) { + count += CPU_ISSET(i, cs) ? 1 : 0; + } + return count; +} + +int pthread_getaffinity_np(pthread_t thread, + size_t cpu_size, + cpu_set_t *cpu_set) { + thread_port_t mach_thread; + mach_msg_type_number_t count = THREAD_AFFINITY_POLICY_COUNT; + boolean_t get_default = false; + + thread_affinity_policy_data_t policy; + mach_thread = pthread_mach_thread_np(thread); + thread_policy_get(mach_thread, THREAD_AFFINITY_POLICY, + (thread_policy_t)&policy, &count, + &get_default); + cpu_set->count |= (1<<(policy.affinity_tag)); + return 0; +} + +int pthread_setaffinity_np(pthread_t thread, + size_t cpu_size, + cpu_set_t *cpu_set) { + thread_port_t mach_thread; + int core = 0; + + for (core=0; core<8*cpu_size; core++) { + if (CPU_ISSET(core, cpu_set)) break; + } + thread_affinity_policy_data_t policy = { core }; + mach_thread = pthread_mach_thread_np(thread); + thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, + (thread_policy_t)&policy, 1); + return 0; +} + +#endif + // Note: Pass core_id = -1 to unbind BFstatus bfAffinitySetCore(int core) { -#if defined __linux__ && __linux__ +#if (defined __linux__ && __linux__) || (defined __APPLE__ && __APPLE__) // Check for valid core int ncore = sysconf(_SC_NPROCESSORS_ONLN); BF_ASSERT(core >= -1 && core < ncore, BF_STATUS_INVALID_ARGUMENT); @@ -69,10 +139,11 @@ BFstatus bfAffinitySetCore(int core) { } #else #warning CPU core binding/affinity not supported on this OS - return BF_STATUS_UNSUPPORTED; + return BF_STATUS_UNSUPPORTED; #endif } BFstatus bfAffinityGetCore(int* core) { +#if (defined __linux__ && __linux__) || (defined __APPLE__ && __APPLE__) BF_ASSERT(core, BF_STATUS_INVALID_POINTER); pthread_t tid = pthread_self(); cpu_set_t cpuset; @@ -82,7 +153,7 @@ BFstatus bfAffinityGetCore(int* core) { // Return -1 if more than one core is set // TODO: Should really check if all cores are set, otherwise fail *core = -1; - return BF_STATUS_SUCCESS; + return BF_STATUS_SUCCESS; } else { int ncore = sysconf(_SC_NPROCESSORS_ONLN); @@ -95,9 +166,14 @@ BFstatus bfAffinityGetCore(int* core) { } // No cores are set! (Not sure if this is possible) return BF_STATUS_INVALID_STATE; +#else +#warning CPU core binding/affinity not supported on this OS + return BF_STATUS_UNSUPPORTED; +#endif } BFstatus bfAffinitySetOpenMPCores(BFsize nthread, const int* thread_cores) { +#if BF_OPENMP_ENABLED int host_core = -1; // TODO: Check these for errors bfAffinityGetCore(&host_core); @@ -109,4 +185,7 @@ BFstatus bfAffinitySetOpenMPCores(BFsize nthread, bfAffinitySetCore(thread_cores[tid]); } return bfAffinitySetCore(host_core); +#else + return BF_STATUS_UNSUPPORTED; +#endif } diff --git a/src/array_utils.hpp b/src/array_utils.hpp index 5c83cb44e..0f2e66365 100644 --- a/src/array_utils.hpp +++ b/src/array_utils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,15 +56,19 @@ inline std::string dtype2ctype_string(BFdtype dtype) { case BF_DTYPE_U64: return "unsigned long long"; case BF_DTYPE_F32: return "float"; case BF_DTYPE_F64: return "double"; +#if defined BF_FLOAT128_ENABLED && BF_FLOAT128_ENABLED //case BF_DTYPE_F128: return "long double"; // TODO: This doesn't seem to work properly in CUDA +#endif case BF_DTYPE_CI4: return "Complex"; case BF_DTYPE_CI8: return "Complex"; case BF_DTYPE_CI16: return "Complex"; - //case BF_DTYPE_CI32: return "complex"; + case BF_DTYPE_CI32: return "Complex"; //case BF_DTYPE_CI64: return "complex"; case BF_DTYPE_CF32: return "Complex";//complex"; case BF_DTYPE_CF64: return "Complex"; +#if defined BF_FLOAT128_ENABLED && BF_FLOAT128_ENABLED //case BF_DTYPE_CF128: return "complex"; +#endif default: return ""; } } diff --git a/src/assert.hpp b/src/assert.hpp index 1328fc1db..b3cdcc5a5 100644 --- a/src/assert.hpp +++ b/src/assert.hpp @@ -29,8 +29,10 @@ #pragma once +#include #include +#include #include class BFexception : public std::runtime_error { @@ -53,7 +55,7 @@ inline bool should_report_error(BFstatus err) { #include using std::cout; using std::endl; -#if defined(BF_DEBUG) && BF_DEBUG +#if defined(BF_DEBUG_ENABLED) && BF_DEBUG_ENABLED #define BF_REPORT_ERROR(err) do { \ if( bfGetDebugEnabled() && \ should_report_error(err) ) { \ @@ -80,7 +82,7 @@ using std::endl; #define BF_REPORT_ERROR(err) #define BF_DEBUG_PRINT(x) #define BF_REPORT_PREDFAIL(pred, err) -#endif // BF_DEBUG +#endif // BF_DEBUG_ENABLED #define BF_REPORT_INTERNAL_ERROR(msg) do { \ std::cerr << __FILE__ << ":" << __LINE__ \ << " internal error: " \ diff --git a/src/autodep.mk b/src/autodep.mk index a3fae6eeb..d11031514 100644 --- a/src/autodep.mk +++ b/src/autodep.mk @@ -17,44 +17,37 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(GCCFLAGS) $(TARGET_ARCH) -c COMPILE.nvcc = $(NVCC) $(NVCCFLAGS) $(CPPFLAGS) -Xcompiler "$(GCCFLAGS)" $(TARGET_ARCH) -c POSTCOMPILE = mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d -CLEAR_LINE = tput el && echo -n "\033[2K" || true # Clears the current line - %.o : %.c %.o : %.c $(DEPDIR)/%.d - @$(CLEAR_LINE) - @echo -n "Building C source file $<\r" + @echo "Building C source file $<" @$(DEPBUILD.c) $< > /dev/null $(COMPILE.c) $(OUTPUT_OPTION) $< @$(POSTCOMPILE) %.o : %.cpp %.o : %.cpp $(DEPDIR)/%.d - @$(CLEAR_LINE) - @echo -n "Building C++ source file $<\r" + @echo "Building C++ source file $<" $(DEPBUILD.cc) $< > /dev/null $(COMPILE.cc) $(OUTPUT_OPTION) $< $(POSTCOMPILE) %.o : %.cc %.o : %.cc $(DEPDIR)/%.d - @$(CLEAR_LINE) - @echo -n "Building C++ source file $<\r" + @echo "Building C++ source file $<" @$(DEPBUILD.cc) $< > /dev/null $(COMPILE.cc) $(OUTPUT_OPTION) $< @$(POSTCOMPILE) %.o : %.cxx %.o : %.cxx $(DEPDIR)/%.d - @$(CLEAR_LINE) - @echo -n "Building C++ source file $<\r" + @echo "Building C++ source file $<" @$(DEPBUILD.cc) $< > /dev/null $(COMPILE.cc) $(OUTPUT_OPTION) $< @$(POSTCOMPILE) %.o : %.cu %.o : %.cu $(DEPDIR)/%.d - @$(CLEAR_LINE) - @echo -n "Building CUDA source file $<\r" + @echo "Building CUDA source file $<" @$(DEPBUILD.cc) $< > /dev/null $(COMPILE.nvcc) $(OUTPUT_OPTION) $< @$(POSTCOMPILE) diff --git a/src/bifrost/address.h b/src/bifrost/address.h index 83af21df8..a078f4ece 100644 --- a/src/bifrost/address.h +++ b/src/bifrost/address.h @@ -44,6 +44,7 @@ BFstatus bfAddressCreate(BFaddress* addr, BFstatus bfAddressDestroy(BFaddress addr); BFstatus bfAddressGetFamily(BFaddress addr, unsigned* family); BFstatus bfAddressGetPort(BFaddress addr, int* port); +BFstatus bfAddressIsMulticast(BFaddress addr, int* multicast); BFstatus bfAddressGetMTU(BFaddress addr, int* mtu); BFstatus bfAddressGetString(BFaddress addr, BFsize bufsize, // 128 should always be enough diff --git a/src/bifrost/array.h b/src/bifrost/array.h index 68c06965d..f87ba4a39 100644 --- a/src/bifrost/array.h +++ b/src/bifrost/array.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -74,7 +74,9 @@ typedef enum BFdtype_ { BF_DTYPE_F16 = 16 | BF_DTYPE_FLOAT_TYPE, BF_DTYPE_F32 = 32 | BF_DTYPE_FLOAT_TYPE, BF_DTYPE_F64 = 64 | BF_DTYPE_FLOAT_TYPE, +#if defined BF_FLOAT128_ENABLED && BF_FLOAT128_ENABLED BF_DTYPE_F128 = 128 | BF_DTYPE_FLOAT_TYPE, +#endif BF_DTYPE_CI1 = 1 | BF_DTYPE_INT_TYPE | BF_DTYPE_COMPLEX_BIT, BF_DTYPE_CI2 = 2 | BF_DTYPE_INT_TYPE | BF_DTYPE_COMPLEX_BIT, @@ -87,7 +89,9 @@ typedef enum BFdtype_ { BF_DTYPE_CF16 = 16 | BF_DTYPE_FLOAT_TYPE | BF_DTYPE_COMPLEX_BIT, BF_DTYPE_CF32 = 32 | BF_DTYPE_FLOAT_TYPE | BF_DTYPE_COMPLEX_BIT, BF_DTYPE_CF64 = 64 | BF_DTYPE_FLOAT_TYPE | BF_DTYPE_COMPLEX_BIT, +#if defined BF_FLOAT128_ENABLED && BF_FLOAT128_ENABLED BF_DTYPE_CF128 = 128 | BF_DTYPE_FLOAT_TYPE | BF_DTYPE_COMPLEX_BIT +#endif } BFdtype; /* typedef struct BFdtype_info_ { diff --git a/src/bifrost/config.h.in b/src/bifrost/config.h.in new file mode 100644 index 000000000..5a97d7f6f --- /dev/null +++ b/src/bifrost/config.h.in @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021-2022, The Bifrost Authors. All rights reserved. + * Copyright (c) 2021-2022, The University of New Mexico. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*! \file config.h + * \brief Configuration parameters used for building the library + */ + +#ifndef BF_CONFIG_H_INCLUDE_GUARD_ +#define BF_CONFIG_H_INCLUDE_GUARD_ + +#ifdef __cplusplus +extern "C" { +#endif + +// Memory alignment +#define BF_ALIGNMENT @ALIGNMENT@ + +// CUDA support +#define BF_CUDA_ENABLED @HAVE_CUDA@ +#define BF_CUDA_VERSION @CUDA_VERSION@ +#define BF_GPU_ARCHS "@GPU_ARCHS@" +#define BF_GPU_MIN_ARCH @GPU_MIN_ARCH@ +#define BF_GPU_MAX_ARCH @GPU_MAX_ARCH@ +#define BF_GPU_SHAREDMEM @GPU_SHAREDMEM@ +#define BF_GPU_MANAGEDMEM @GPU_PASCAL_MANAGEDMEM@ +#define BF_GPU_EXP_PINNED_ALLOC @GPU_EXP_PINNED_ALLOC@ +#define BF_MAP_KERNEL_STDCXX "@MAP_KERNEL_STDCXX@" +#define BF_MAP_KERNEL_DISK_CACHE @HAVE_MAP_CACHE@ +#define BF_MAP_KERNEL_DISK_CACHE_VERSION (1000*@PACKAGE_VERSION_MAJOR@ + 10*@PACKAGE_VERSION_MINOR@) + +// Features +#define BF_SSE_ENABLED @HAVE_SSE@ +#define BF_AVX_ENABLED @HAVE_AVX@ +#define BF_AVX512_ENABLED @HAVE_AVX512@ +#define BF_FLOAT128_ENABLED @HAVE_FLOAT128@ +#define BF_OPENMP_ENABLED @HAVE_OPENMP@ +#define BF_HWLOC_ENABLED @HAVE_HWLOC@ +#define BF_VMA_ENABLED @HAVE_VMA@ +#define BF_VERBS_ENABLED @HAVE_VERBS@ +#define BF_VERBS_NPKTBUF @VERBS_NPKTBUF@ +#define BF_VERBS_SEND_NPKTBUF @VERBS_SEND_NPKTBUF@ +#define BF_VERBS_SEND_PACING @VERBS_SEND_PACING@ +#define BF_RDMA_ENABLED @HAVE_RDMA@ +#define BF_RDMA_MAXMEM @RDMA_MAXMEM@ + +// Debugging features +#define BF_DEBUG_ENABLED @HAVE_DEBUG@ +#define BF_TRACE_ENABLED @HAVE_TRACE@ +#define BF_CUDA_DEBUG_ENABLED @HAVE_CUDA_DEBUG@ + +// Logging directory +#define BF_PROCLOG_DIR "@HAVE_TMPFS@" + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // BF_CONFIG_H_INCLUDE_GUARD_ diff --git a/src/bifrost/udp_transmit.h b/src/bifrost/io.h similarity index 65% rename from src/bifrost/udp_transmit.h rename to src/bifrost/io.h index e3336ccad..a5ef3616e 100644 --- a/src/bifrost/udp_transmit.h +++ b/src/bifrost/io.h @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017, The Bifrost Authors. All rights reserved. - * Copyright (c) 2017, The University of New Mexico. All rights reserved. + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,30 +26,31 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef BF_UDP_TRANSMIT_H_INCLUDE_GUARD_ -#define BF_UDP_TRANSMIT_H_INCLUDE_GUARD_ +#ifndef BF_IO_H_INCLUDE_GUARD_ +#define BF_IO_H_INCLUDE_GUARD_ + +#include #ifdef __cplusplus extern "C" { #endif -typedef struct BFudptransmit_impl* BFudptransmit; - -typedef enum BFudptransmit_status_ { - BF_TRANSMIT_CONTINUED, - BF_TRANSMIT_INTERRUPTED, - BF_TRANSMIT_ERROR -} BFudptransmit_status; +typedef enum BFiomethod_ { + BF_IO_GENERIC = 0, + BF_IO_DISK = 1, + BF_IO_UDP = 2, + BF_IO_SNIFFER = 3, + BF_IO_VERBS = 4 +} BFiomethod; -BFstatus bfUdpTransmitCreate(BFudptransmit* obj, - int fd, - int core); -BFstatus bfUdpTransmitDestroy(BFudptransmit obj); -BFstatus bfUdpTransmitSend(BFudptransmit obj, char* packet, unsigned int len); -BFstatus bfUdpTransmitSendMany(BFudptransmit obj, char* packets, unsigned int len, unsigned int npackets); +typedef enum BFiowhence_ { + BF_WHENCE_SET = SEEK_SET, + BF_WHENCE_CUR = SEEK_CUR, + BF_WHENCE_END = SEEK_END +} BFiowhence; #ifdef __cplusplus } // extern "C" #endif -#endif // BF_UDP_TRANSMIT_H_INCLUDE_GUARD_ +#endif // BF_IO_H_INCLUDE_GUARD_ diff --git a/src/bifrost/map.h b/src/bifrost/map.h index e3c3c8f09..8cfeb2f28 100644 --- a/src/bifrost/map.h +++ b/src/bifrost/map.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -91,6 +91,12 @@ BFstatus bfMap(int ndim, int const* block_shape, // Must be array of length 2, or NULL int const* block_axes); // Must be array of length 2, or NULL +BFstatus bfMapClearCache(); + +#define BF_MAP_KERNEL_CACHE_SIZE 128 +#define BF_MAP_KERNEL_DISK_CACHE_SUBDIR "map_cache" +#define BF_MAP_KERNEL_DISK_CACHE_VERSION_FILE "cache.version" + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/bifrost/memory.h b/src/bifrost/memory.h index 653a701f0..48624ae3c 100644 --- a/src/bifrost/memory.h +++ b/src/bifrost/memory.h @@ -40,10 +40,6 @@ extern "C" { #endif -#ifndef BF_ALIGNMENT - #define BF_ALIGNMENT 4096//512 -#endif - typedef enum BFspace_ { BF_SPACE_AUTO = 0, BF_SPACE_SYSTEM = 1, // aligned_alloc diff --git a/src/bifrost/packet_capture.h b/src/bifrost/packet_capture.h new file mode 100644 index 000000000..c81485d2e --- /dev/null +++ b/src/bifrost/packet_capture.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef BF_PACKET_CAPTURE_H_INCLUDE_GUARD_ +#define BF_PACKET_CAPTURE_H_INCLUDE_GUARD_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +// Callback setup + +typedef int (*BFpacketcapture_simple_sequence_callback)(BFoffset, int, int, int, + BFoffset*, void const**, size_t*); +typedef int (*BFpacketcapture_chips_sequence_callback)(BFoffset, int, int, int, + BFoffset*, void const**, size_t*); +typedef int (*BFpacketcapture_snap2_sequence_callback)(BFoffset, int, int, int, + BFoffset*, void const**, size_t*); +typedef int (*BFpacketcapture_ibeam_sequence_callback)(BFoffset, int, int, int, + BFoffset*, void const**, size_t*); +typedef int (*BFpacketcapture_pbeam_sequence_callback)(BFoffset, BFoffset, int, int, int, + int, void const**, size_t*); +typedef int (*BFpacketcapture_cor_sequence_callback)(BFoffset, BFoffset, int, int, + int, int, void const**, size_t*); +typedef int (*BFpacketcapture_vdif_sequence_callback)(BFoffset, BFoffset, int, int, int, + int, int, int, void const**, size_t*); +typedef int (*BFpacketcapture_tbn_sequence_callback)(BFoffset, BFoffset, int, int, + int, void const**, size_t*); +typedef int (*BFpacketcapture_drx_sequence_callback)(BFoffset, BFoffset, int, int, int, + int, void const**, size_t*); +typedef int (*BFpacketcapture_drx8_sequence_callback)(BFoffset, BFoffset, int, int, int, + int, void const**, size_t*); + +typedef struct BFpacketcapture_callback_impl* BFpacketcapture_callback; + +BFstatus bfPacketCaptureCallbackCreate(BFpacketcapture_callback* obj); +BFstatus bfPacketCaptureCallbackDestroy(BFpacketcapture_callback obj); +BFstatus bfPacketCaptureCallbackSetSIMPLE(BFpacketcapture_callback obj, + BFpacketcapture_simple_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetCHIPS(BFpacketcapture_callback obj, + BFpacketcapture_chips_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetSNAP2(BFpacketcapture_callback obj, + BFpacketcapture_snap2_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetIBeam(BFpacketcapture_callback obj, + BFpacketcapture_ibeam_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetPBeam(BFpacketcapture_callback obj, + BFpacketcapture_pbeam_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetCOR(BFpacketcapture_callback obj, + BFpacketcapture_cor_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetVDIF(BFpacketcapture_callback obj, + BFpacketcapture_vdif_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetTBN(BFpacketcapture_callback obj, + BFpacketcapture_tbn_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetDRX(BFpacketcapture_callback obj, + BFpacketcapture_drx_sequence_callback callback); +BFstatus bfPacketCaptureCallbackSetDRX8(BFpacketcapture_callback obj, + BFpacketcapture_drx8_sequence_callback callback); + +// Capture setup + +typedef struct BFpacketcapture_impl* BFpacketcapture; + +typedef enum BFpacketcapture_status_ { + BF_CAPTURE_STARTED, + BF_CAPTURE_ENDED, + BF_CAPTURE_CONTINUED, + BF_CAPTURE_CHANGED, + BF_CAPTURE_NO_DATA, + BF_CAPTURE_INTERRUPTED, + BF_CAPTURE_ERROR +} BFpacketcapture_status; + +BFstatus bfDiskReaderCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core); +BFstatus bfUdpCaptureCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core); +BFstatus bfUdpSnifferCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core); +BFstatus bfUdpVerbsCaptureCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core); +BFstatus bfPacketCaptureDestroy(BFpacketcapture obj); +BFstatus bfPacketCaptureRecv(BFpacketcapture obj, + BFpacketcapture_status* result); +BFstatus bfPacketCaptureFlush(BFpacketcapture obj); +BFstatus bfPacketCaptureSeek(BFpacketcapture obj, + BFoffset offset, + BFiowhence whence, + BFoffset* position); +BFstatus bfPacketCaptureTell(BFpacketcapture obj, + BFoffset* position); +BFstatus bfPacketCaptureEnd(BFpacketcapture obj); +// TODO: bfPacketCaptureGetXX + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // BF_PACKET_CAPTURE_H_INCLUDE_GUARD_ diff --git a/src/bifrost/packet_writer.h b/src/bifrost/packet_writer.h new file mode 100644 index 000000000..133a7ac4b --- /dev/null +++ b/src/bifrost/packet_writer.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef BF_PACKET_WRITER_H_INCLUDE_GUARD_ +#define BF_PACKET_WRITER_H_INCLUDE_GUARD_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef struct BFheaderinfo_impl* BFheaderinfo; + +BFstatus bfHeaderInfoCreate(BFheaderinfo* obj); +BFstatus bfHeaderInfoDestroy(BFheaderinfo obj); +BFstatus bfHeaderInfoSetNSrc(BFheaderinfo obj, + int nsrc); +BFstatus bfHeaderInfoSetNChan(BFheaderinfo obj, + int nchan); +BFstatus bfHeaderInfoSetChan0(BFheaderinfo obj, + int chan0); +BFstatus bfHeaderInfoSetTuning(BFheaderinfo obj, + int tuning); +BFstatus bfHeaderInfoSetGain(BFheaderinfo obj, + unsigned short int gain); +BFstatus bfHeaderInfoSetDecimation(BFheaderinfo obj, + unsigned int decimation); + +typedef struct BFpacketwriter_impl* BFpacketwriter; + +BFstatus bfDiskWriterCreate(BFpacketwriter* obj, + const char* format, + int fd, + int core); +BFstatus bfUdpTransmitCreate(BFpacketwriter* obj, + const char* format, + int fd, + int core); +BFstatus bfUdpVerbsTransmitCreate(BFpacketwriter* obj, + const char* format, + int fd, + int core); +BFstatus bfPacketWriterDestroy(BFpacketwriter obj); +BFstatus bfPacketWriterSetRateLimit(BFpacketwriter obj, + unsigned int rate_limit); +BFstatus bfPacketWriterResetRateLimitCounter(BFpacketwriter obj); +BFstatus bfPacketWriterResetCounter(BFpacketwriter obj); +BFstatus bfPacketWriterSend(BFpacketwriter obj, + BFheaderinfo info, + BFoffset seq, + BFoffset seq_increment, + BFoffset src, + BFoffset src_increment, + BFarray const* in); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // BF_PACKET_WRITER_H_INCLUDE_GUARD_ diff --git a/src/bifrost/udp_capture.h b/src/bifrost/rdma.h similarity index 51% rename from src/bifrost/udp_capture.h rename to src/bifrost/rdma.h index 5b8fda741..93ccc9e6c 100644 --- a/src/bifrost/udp_capture.h +++ b/src/bifrost/rdma.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2022, The Bifrost Authors. All rights reserved. + * Copyright (c) 2022, The University of New Mexico. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,50 +27,38 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef BF_UDP_CAPTURE_H_INCLUDE_GUARD_ -#define BF_UDP_CAPTURE_H_INCLUDE_GUARD_ +#ifndef BF_RDMA_H_INCLUDE_GUARD_ +#define BF_RDMA_H_INCLUDE_GUARD_ #ifdef __cplusplus extern "C" { #endif -#include -#include +#include -typedef struct BFudpcapture_impl* BFudpcapture; +typedef struct BFrdma_impl* BFrdma; -typedef int (*BFudpcapture_sequence_callback)(BFoffset, int, int, int, - BFoffset*, void const**, size_t*); - -typedef enum BFudpcapture_status_ { - BF_CAPTURE_STARTED, - BF_CAPTURE_ENDED, - BF_CAPTURE_CONTINUED, - BF_CAPTURE_CHANGED, - BF_CAPTURE_NO_DATA, - BF_CAPTURE_INTERRUPTED, - BF_CAPTURE_ERROR -} BFudpcapture_status; - -BFstatus bfUdpCaptureCreate(BFudpcapture* obj, - const char* format, - int fd, - BFring ring, - BFsize nsrc, - BFsize src0, - BFsize max_payload_size, - BFsize buffer_ntime, - BFsize slot_ntime, - BFudpcapture_sequence_callback sequence_callback, - int core); -BFstatus bfUdpCaptureDestroy(BFudpcapture obj); -BFstatus bfUdpCaptureRecv(BFudpcapture obj, BFudpcapture_status* result); -BFstatus bfUdpCaptureFlush(BFudpcapture obj); -BFstatus bfUdpCaptureEnd(BFudpcapture obj); -// TODO: bfUdpCaptureGetXX +BFstatus bfRdmaCreate(BFrdma* obj, + int fd, + size_t message_size, + int is_server); +BFstatus bfRdmaDestroy(BFrdma obj); +BFstatus bfRdmaSendHeader(BFrdma obj, + BFoffset time_tag, + BFsize header_size, + const void* header, + BFoffset offset_from_head); +BFstatus bfRdmaSendSpan(BFrdma obj, + BFarray const* span); +BFstatus bfRdmaReceive(BFrdma obj, + BFoffset* time_tag, + BFsize* header_size, + BFoffset* offset_from_head, + BFsize* span_size, + void* contents); #ifdef __cplusplus } // extern "C" #endif -#endif // BF_UDP_CAPTURE_H_INCLUDE_GUARD_ +#endif // BF_RDMA_H_INCLUDE_GUARD_ diff --git a/src/bifrost/testsuite.h b/src/bifrost/testsuite.h new file mode 100644 index 000000000..2ad2bb0b3 --- /dev/null +++ b/src/bifrost/testsuite.h @@ -0,0 +1,10 @@ +#pragma once +#ifdef __cplusplus +extern "C" { +#endif + +int bfTestSuite(); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/src/bifrost/udp_socket.h b/src/bifrost/udp_socket.h index 80ff3d1d2..e773256cc 100644 --- a/src/bifrost/udp_socket.h +++ b/src/bifrost/udp_socket.h @@ -41,10 +41,13 @@ BFstatus bfUdpSocketCreate(BFudpsocket* obj); BFstatus bfUdpSocketDestroy(BFudpsocket obj); BFstatus bfUdpSocketConnect(BFudpsocket obj, BFaddress remote_addr); BFstatus bfUdpSocketBind( BFudpsocket obj, BFaddress local_addr); +BFstatus bfUdpSocketSniff( BFudpsocket obj, BFaddress local_addr); BFstatus bfUdpSocketShutdown(BFudpsocket obj); // Unblocks recv in another thread BFstatus bfUdpSocketClose(BFudpsocket obj); BFstatus bfUdpSocketSetTimeout(BFudpsocket obj, double secs); BFstatus bfUdpSocketGetTimeout(BFudpsocket obj, double* secs); +BFstatus bfUdpSocketSetPromiscuous(BFudpsocket obj, int promisc); +BFstatus bfUdpSocketGetPromiscuous(BFudpsocket obj, int* promisc); BFstatus bfUdpSocketGetMTU(BFudpsocket obj, int* mtu); BFstatus bfUdpSocketGetFD(BFudpsocket obj, int* fd); diff --git a/src/common.cpp b/src/common.cpp index a595de8ed..bf6419261 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -27,6 +27,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include @@ -65,17 +66,13 @@ const char* bfGetStatusString(BFstatus status) { #undef BF_STATUS_STRING_CASE } -static thread_local bool g_debug_enabled = true; +static thread_local bool g_debug_enabled = BF_DEBUG_ENABLED; BFbool bfGetDebugEnabled() { -#if BF_DEBUG return g_debug_enabled; -#else - return false; -#endif } BFstatus bfSetDebugEnabled(BFbool b) { -#if !BF_DEBUG +#if !BF_DEBUG_ENABLED return BF_STATUS_INVALID_STATE; #else g_debug_enabled = b; @@ -83,9 +80,5 @@ BFstatus bfSetDebugEnabled(BFbool b) { #endif } BFbool bfGetCudaEnabled() { -#ifdef BF_CUDA_ENABLED - return BF_CUDA_ENABLED; -#else - return false; -#endif + return BF_CUDA_ENABLED; } diff --git a/src/cuda.cpp b/src/cuda.cpp index e8bca57ef..0bc8a9464 100644 --- a/src/cuda.cpp +++ b/src/cuda.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -39,7 +39,7 @@ BFstatus bfStreamGet(void* stream) { #if BF_CUDA_ENABLED *(cudaStream_t*)stream = g_cuda_stream; #else - BF_FAIL("Built with CUDA support (bfStreamGet)", BF_STATUS_INVALID_STATE); + BF_FAIL("Built without CUDA support (bfStreamGet)", BF_STATUS_INVALID_STATE); #endif return BF_STATUS_SUCCESS; } diff --git a/src/cuda.hpp b/src/cuda.hpp index a410ecb7a..c0e08f651 100644 --- a/src/cuda.hpp +++ b/src/cuda.hpp @@ -28,6 +28,7 @@ #pragma once +#include #include #include "assert.hpp" @@ -56,13 +57,17 @@ extern thread_local cudaStream_t g_cuda_stream; #endif inline int get_cuda_device_cc() { - int device; + int device, cc; cudaGetDevice(&device); int cc_major; cudaDeviceGetAttribute(&cc_major, cudaDevAttrComputeCapabilityMajor, device); int cc_minor; cudaDeviceGetAttribute(&cc_minor, cudaDevAttrComputeCapabilityMinor, device); - return cc_major*10 + cc_minor; + cc = cc_major*10 + cc_minor; + if( cc > BF_GPU_MAX_ARCH ) { + cc = BF_GPU_MAX_ARCH; + } + return cc; } #define BF_CHECK_CUDA_EXCEPTION(call, err) \ @@ -170,14 +175,12 @@ class CUDAKernel { smem, stream, &arg_ptrs[0], NULL); } -#if __cplusplus >= 201103L template inline CUresult launch(dim3 grid, dim3 block, unsigned int smem, CUstream stream, Args... args) { return this->launch(grid, block, smem, stream, {(void*)&args...}); } -#endif }; diff --git a/src/cuda/stream.hpp b/src/cuda/stream.hpp index 1d67c2b12..88a41c7a3 100644 --- a/src/cuda/stream.hpp +++ b/src/cuda/stream.hpp @@ -82,7 +82,7 @@ namespace cuda { inline void check_error(cudaError_t ret) { if( ret != cudaSuccess ) { - throw std::runtime_error(cudaGetErrorString(ret)); + throw ::std::runtime_error(cudaGetErrorString(ret)); } } diff --git a/src/fft.cu b/src/fft.cu index 66af32c17..fa2a5429e 100644 --- a/src/fft.cu +++ b/src/fft.cu @@ -34,6 +34,7 @@ TODO: Implicitly padded/cropped transforms using load callback */ +#include #include #include "assert.hpp" #include "utils.hpp" @@ -44,7 +45,11 @@ #include "ArrayIndexer.cuh" #include #include +#if defined(BF_GPU_EXP_PINNED_ALLOC) && BF_GPU_EXP_PINNED_ALLOC #include +#else +#include +#endif #include #include @@ -63,7 +68,11 @@ class BFfft_impl { bool _using_load_callback; thrust::device_vector _dv_tmp_storage; thrust::device_vector _dv_callback_data; +#if defined(BF_GPU_EXP_PINNED_ALLOC) && BF_GPU_EXP_PINNED_ALLOC typedef thrust::cuda::experimental::pinned_allocator pinned_allocator_type; +#else + using pinned_allocator_type = thrust::mr::stateless_resource_allocator; +#endif thrust::host_vector _hv_callback_data; BFstatus execute_impl(BFarray const* in, @@ -266,7 +275,7 @@ BFstatus BFfft_impl::execute_impl(BFarray const* in, // We could potentially use a CUDA event as a lighter-weight // solution. cudaStreamSynchronize(g_cuda_stream); - CallbackData* h_callback_data = &_hv_callback_data[0]; + CallbackData* h_callback_data = thrust::raw_pointer_cast(&_hv_callback_data[0]); // WAR for CUFFT insisting that pointer be aligned to sizeof(cufftComplex) int alignment = (_nbit == 32 ? sizeof(cufftComplex) : @@ -282,7 +291,7 @@ BFstatus BFfft_impl::execute_impl(BFarray const* in, // Set callback data needed for applying fftshift h_callback_data->inverse = _real_out || (!_real_in && inverse); - h_callback_data->do_fftshift = _do_fftshift; + h_callback_data->do_fftshift = _do_fftshift ^ _real_out; h_callback_data->ndim = _axes.size(); for( int d=0; dndim; ++d ) { h_callback_data->shape[d] = in->shape[_axes[d]]; diff --git a/src/fft_kernels.h b/src/fft_kernels.h index f347d0635..0dad4f916 100644 --- a/src/fft_kernels.h +++ b/src/fft_kernels.h @@ -95,7 +95,7 @@ inline BFstatus bifrost_status(cufftResult status) { bifrost_status(cufft_ret)); \ } while(0) -struct CallbackData { +struct __attribute__((packed,aligned(4))) CallbackData { int ptr_offset; int ndim; // Note: These array sizes must be at least the max supported FFT rank diff --git a/src/fileutils.cpp b/src/fileutils.cpp new file mode 100644 index 000000000..0793827b9 --- /dev/null +++ b/src/fileutils.cpp @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2019-2022, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "fileutils.hpp" +#include +#include +#include // strerror + +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM +#include +#endif + +std::string get_home_dir(void) { + const char *homedir; + if ((homedir = getenv("HOME")) == NULL) { + homedir = getpwuid(getuid())->pw_dir; + } + return std::string(homedir); +} + +/* NOTE: For convenience on systems with compilers without C++17 support, these + functions build a shell command and pass it to system(). The PATH argument is + not shell-quoted or otherwise sanitized, so only use with program constants, + not with data from command line or config files. */ + +void make_dir(std::string path, int perms) { +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM + bool created = std::filesystem::create_directories(path); + if(created) { + std::filesystem::permissions(path, (std::filesystem::perms) perms, + std::filesystem::perm_options::replace); + } +#else + std::ostringstream cmd; + cmd << "mkdir -p -m " << std::oct << perms << ' ' << path; + if( std::system(cmd.str().c_str()) ) { + throw std::runtime_error("Failed to create path: "+path); + } +#endif +} +void remove_files_recursively(std::string path) { +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM + std::filesystem::remove_all(path); +#else + if( std::system(("rm -rf "+path).c_str()) ) { + throw std::runtime_error("Failed to remove all: "+path); + } +#endif +} +void remove_dir(std::string path) { +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM + std::filesystem::remove(path); +#else + if(rmdir(path.c_str()) != 0) { + throw std::runtime_error("Failed to remove dir: "+path); + } +#endif +} +void remove_file(std::string path) { +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM + std::filesystem::remove(path); +#else + if(unlink(path.c_str()) != 0) { + // Previously this was an 'rm -f', which is silent on non-existent path. + if(errno != ENOENT) { + throw std::runtime_error("Failed to remove file: "+path); + } + } +#endif +} + +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM +static bool ends_with (std::string const &fullString, std::string const &ending) { +#if defined(HAVE_CXX_ENDS_WITH) && HAVE_CXX_ENDS_WITH + return fullString.ends_with(ending); +#else +// ends_with will be available in C++20; this is suggested as alternative +// at https://stackoverflow.com/questions/874134 + if (fullString.length() >= ending.length()) { + return (0 == fullString.compare(fullString.length() - ending.length(), + ending.length(), ending)); + } else { + return false; + } +#endif +} +#endif + +void remove_files_with_suffix(std::string dir, std::string suffix) { + if(dir.empty()) { + throw std::runtime_error("Empty DIR argument"); + } + if(suffix.empty()) { + throw std::runtime_error("Empty SUFFIX argument"); + } +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM + // Iterate through the directory's contents and remove the matches + std::filesystem::path path = dir; + for(auto const& entry : std::filesystem::directory_iterator{dir}) { + std::filesystem::path epath = entry.path(); + if( ends_with(epath.string(), suffix) ) { + std::filesystem::remove(epath); + } + } +#else + std::string wild = dir + "/*" + suffix; + if( std::system(("rm -f "+wild).c_str()) ) { + throw std::runtime_error("Failed to remove files: "+wild); + } +#endif +} + +bool file_exists(std::string path) { +#if defined(HAVE_CXX_FILESYSTEM) && HAVE_CXX_FILESYSTEM + return std::filesystem::exists(path); +#else + struct stat s; + return !(stat(path.c_str(), &s) == -1 + && errno == ENOENT); +#endif +} +bool process_exists(pid_t pid) { +#if defined(__APPLE__) && __APPLE__ + + // Based on information from: + // https://developer.apple.com/library/archive/qa/qa2001/qa1123.html + + static const int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; + kinfo_proc *proclist = NULL; + int err, found = 0; + size_t len, count; + len = 0; + err = sysctl((int *) name, (sizeof(name) / sizeof(*name)) - 1, + NULL, &len, NULL, 0); + if( err == 0 ) { + proclist = (kinfo_proc*) ::malloc(len); + err = sysctl((int *) name, (sizeof(name) / sizeof(*name)) - 1, + proclist, &len, NULL, 0); + if( err == 0 ) { + count = len / sizeof(kinfo_proc); + for(int i=0; i 0) { + std::cerr << "NOTE: acquired " << lockfile << std::endl; + } + // Exit the busy loop + break; + } + // Locking succeeded, but inodes were different so try again. + flock(_fd, LOCK_UN); + } + close(_fd); + } + busycount++; + if(busycount % busyinterval == 0) { + elapsed = time(NULL) - start; + if(elapsed >= 5) { + std::cerr << "NOTE: waiting " << elapsed + << "s for " << lockfile << std::endl; + busyinterval = busycount; + } + } + } + // We have the lock, so try writing PID. + if(ftruncate(_fd, 0) == -1) { + std::cerr << "WARNING: could not truncate " << lockfile << ": " + << strerror(errno) << std::endl; + } + else { + std::ostringstream ss; + ss << pid << '\n'; + std::string buf = ss.str(); + if(write(_fd, buf.c_str(), buf.size()) != (ssize_t)buf.size()) { + std::cerr << "WARNING: could not write to " << lockfile << ": " + << strerror(errno) << std::endl; + } + } +} + +LockFile::~LockFile() { + unlink(_lockfile.c_str()); + flock(_fd, LOCK_UN); + close(_fd); +} + + +#ifdef FILEUTILS_LOCKFILE_TEST +// This is a little test program for LockFile. Run it in two terminals +// to simulate race conditions, or kill one to leave a a leftover lock file. +// Output should look something like this: + +// Initiating lock... +// NOTE: waiting 5s for ./myfile.lock +// NOTE: waiting 9s for ./myfile.lock +// NOTE: waiting 17s for ./myfile.lock +// NOTE: waiting 34s for ./myfile.lock +// [Delete the file from another terminal] +// NOTE: acquired ./myfile.lock +// Lock acquired... exiting + +int main() { + std::cerr << "Initiating lock..." << std::endl; + LockFile lock("./myfile.lock"); + std::cerr << "Lock acquired, 'working' for 15s..." << std::endl; + sleep(15); + std::cerr << "Work finished, releasing lock..." << std::endl; + return 0; +} +#endif diff --git a/src/fileutils.hpp b/src/fileutils.hpp new file mode 100644 index 000000000..0017c3966 --- /dev/null +++ b/src/fileutils.hpp @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2019-2022, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include + +#include // For flock +#include // For fstat +#include // For getpid +#include // For getpid +#include // For getpwuid +#include +#include + +#if defined(__APPLE__) && __APPLE__ +#include +#endif + +std::string get_home_dir(void); +void make_dir(std::string path, int perms=0775); +void remove_files_recursively(std::string path); +void remove_dir(std::string path); +void remove_file(std::string path); +void remove_files_with_suffix(std::string dir, std::string suffix); +bool file_exists(std::string path); +bool process_exists(pid_t pid); + +std::string get_dirname(std::string filename); + +class LockFile { + std::string _lockfile; + int _fd; +public: + LockFile(LockFile const& ) = delete; + LockFile& operator=(LockFile const& ) = delete; + LockFile(std::string lockfile); + ~LockFile(); +}; diff --git a/src/formats/base.hpp b/src/formats/base.hpp new file mode 100644 index 000000000..2cca0a789 --- /dev/null +++ b/src/formats/base.hpp @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2019-2022, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include // For posix_memalign +#include // For memcpy, memset +#include + +#include // For ntohs + +#if defined BF_SSE_ENABLED && BF_SSE_ENABLED + +#include + +#endif + +#if defined BF_AVX_ENABLED && BF_AVX_ENABLED + +#include + +#endif + +#if defined BF_AVX512_ENABLED && BF_AVX512_ENABLED + +#include + +#endif + +#if defined __APPLE__ && __APPLE__ + +#include +#define htobe16(x) OSSwapHostToBigInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define htobe32(x) OSSwapHostToBigInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define htobe64(x) OSSwapHostToBigInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) + +#endif + +#define BF_UNPACK_FACTOR 1 + +#define JUMBO_FRAME_SIZE 9000 + +struct unaligned128_type { + uint8_t data[16]; +}; +struct __attribute__((aligned(16))) aligned128_type { + uint8_t data[16]; +}; +struct unaligned256_type { + uint8_t data[32]; +}; +struct __attribute__((aligned(32))) aligned256_type { + uint8_t data[32]; +}; +struct unaligned512_type { + uint8_t data[64]; +}; +struct __attribute__((aligned(64))) aligned512_type { + uint8_t data[64]; +}; + + +struct PacketDesc { + uint64_t seq; + int nsrc; + int src; + int nchan; + int chan0; + int nchan_tot; + int npol; + int pol0; + int npol_tot; + uint32_t sync; + uint64_t time_tag; + int tuning; + int tuning1 = 0; + uint8_t beam; + uint16_t gain; + uint32_t decimation; + uint8_t valid_mode; + int payload_size; + const uint8_t* payload_ptr; +}; + + +class PacketDecoder { +protected: + int _nsrc; + int _src0; +private: + virtual inline bool valid_packet(const PacketDesc* pkt) const { + return false; + } +public: + PacketDecoder(int nsrc, int src0) : _nsrc(nsrc), _src0(src0) {} + virtual inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + return false; + } +}; + + +class PacketProcessor { +public: + virtual inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) {} + virtual inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) {} +}; + + +class PacketHeaderFiller { +public: + virtual inline int get_size() { return 0; } + virtual inline void operator()(const PacketDesc* hdr_base, + BFoffset framecount, + char* hdr) {} +}; diff --git a/src/formats/chips.hpp b/src/formats/chips.hpp new file mode 100644 index 000000000..fd9a371bb --- /dev/null +++ b/src/formats/chips.hpp @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +struct __attribute__((packed)) chips_hdr_type { + uint8_t roach; // Note: 1-based + uint8_t gbe; // (AKA tuning) + uint8_t nchan; // 109 + uint8_t nsubband; // 11 + uint8_t subband; // 0-11 + uint8_t nroach; // 16 + // Note: Big endian + uint16_t chan0; // First chan in packet + uint64_t seq; // Note: 1-based +}; + +class CHIPSDecoder : virtual public PacketDecoder { + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->seq >= 0 && + pkt->src >= 0 && pkt->src < _nsrc && + pkt->chan0 >= 0); + } +public: + CHIPSDecoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(chips_hdr_type) ) { + return false; + } + const chips_hdr_type* pkt_hdr = (chips_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(chips_hdr_type); + int pld_size = pkt_size - sizeof(chips_hdr_type); + pkt->seq = be64toh(pkt_hdr->seq) - 1; + //pkt->nsrc = pkt_hdr->nroach; + pkt->nsrc = _nsrc; + pkt->src = (pkt_hdr->roach - 1) - _src0; + pkt->nchan = pkt_hdr->nchan; + pkt->chan0 = ntohs(pkt_hdr->chan0); + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + return this->valid_packet(pkt); + } +}; + +class CHIPSProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + enum { + PKT_NINPUT = 32, + PKT_NBIT = 4 + }; + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size * BF_UNPACK_FACTOR; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + // **CHANGED RECENTLY + int payload_size = pkt->payload_size;//pkt->nchan*(PKT_NINPUT*2*PKT_NBIT/8); + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef unaligned256_type itype; + typedef aligned256_type otype; + + obuf_offset *= BF_UNPACK_FACTOR; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + int chan = 0; + //cout << pkt->src << ", " << pkt->nsrc << endl; + //cout << pkt->nchan << endl; + for( ; channchan; ++chan ) { +#if defined BF_AVX_ENABLED && BF_AVX_ENABLED + const unaligned256_type* dsrc = (const unaligned256_type*) &in[chan]; + aligned256_type* ddst = (aligned256_type*) &out[pkt->src + pkt->nsrc*chan]; + + __m256 mtemp = _mm256_loadu_si256(reinterpret_cast(dsrc)); + _mm256_stream_si256(reinterpret_cast<__m256i*>(ddst), mtemp); +#else +#if defined BF_SSE_ENABLED && BF_SSE_ENABLED + const unaligned128_type* dsrc = (const unaligned128_type*) &in[chan]; + aligned128_type* ddst = (aligned128_type*) &out[pkt->src + pkt->nsrc*chan]; + + __m128i mtemp = _mm_loadu_si128(reinterpret_cast(dsrc)); + _mm_stream_si128(reinterpret_cast<__m128i*>(ddst), mtemp); + mtemp = _mm_loadu_si128(reinterpret_cast(dsrc+1)); + _mm_stream_si128(reinterpret_cast<__m128i*>(ddst+1), mtemp); +#else + ::memcpy(&out[pkt->src + pkt->nsrc*chan], + &in[chan], sizeof(otype)); +#endif +#endif + } + } + + inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) { + typedef aligned256_type otype; + otype* __restrict__ aligned_data = (otype*)data; + for( int t=0; t(ddst), mtemp); +#else +#if defined BF_SSE_ENABLED && BF_SSE_ENABLED + aligned128_type* ddst = (aligned128_type*) &aligned_data[src + nsrc*(c + nchan*t)]; + + __m128i mtemp = _mm_setzero_si128(); + _mm_stream_si128(reinterpret_cast<__m128i*>(ddst), mtemp); + _mm_stream_si128(reinterpret_cast<__m128i*>(ddst+1), mtemp); +#else + ::memset(&aligned_data[src + nsrc*(c + nchan*t)], + 0, sizeof(otype)); +#endif +#endif + } + } + } +}; + +class CHIPSHeaderFiller : virtual public PacketHeaderFiller { +public: + inline int get_size() { return sizeof(chips_hdr_type); } + inline void operator()(const PacketDesc* hdr_base, + BFoffset framecount, + char* hdr) { + chips_hdr_type* header = reinterpret_cast(hdr); + memset(header, 0, sizeof(chips_hdr_type)); + + header->roach = hdr_base->src + 1; + header->gbe = hdr_base->tuning; + header->nchan = hdr_base->nchan; + header->nsubband = 1; // Should be changable? + header->subband = 0; // Should be changable? + header->nroach = hdr_base->nsrc; + header->chan0 = htons(hdr_base->chan0); + header->seq = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/cor.hpp b/src/formats/cor.hpp new file mode 100644 index 000000000..bf1660ded --- /dev/null +++ b/src/formats/cor.hpp @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2019-2021, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" +#include + +struct __attribute__((packed)) cor_hdr_type { + uint32_t sync_word; + uint32_t frame_count_word; + uint32_t second_count; + uint16_t first_chan; + uint16_t gain; + uint64_t time_tag; + uint32_t navg; + uint16_t stand0; + uint16_t stand1; +}; + +class CORDecoder : virtual public PacketDecoder { + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->sync == 0x5CDEC0DE && + pkt->src >= 0 && + pkt->src < pkt->nsrc && + pkt->time_tag >= 0 && + pkt->chan0 >= 0); + } +public: + CORDecoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(cor_hdr_type) ) { + return false; + } + const cor_hdr_type* pkt_hdr = (cor_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(cor_hdr_type); + int pld_size = pkt_size - sizeof(cor_hdr_type); + uint8_t nchan_decim = (be32toh(pkt_hdr->frame_count_word) >> 16) & 0xFF; + uint8_t nserver = (be32toh(pkt_hdr->frame_count_word) >> 8) & 0xFF; + uint8_t server = be32toh(pkt_hdr->frame_count_word) & 0xFF; + uint16_t nchan_pkt = (pld_size/(8*4)); + uint16_t stand0 = be16toh(pkt_hdr->stand0) - 1; + uint16_t stand1 = be16toh(pkt_hdr->stand1) - 1; + uint16_t nstand = (sqrt(8*_nsrc/nserver+1)-1)/2; + pkt->sync = pkt_hdr->sync_word; + pkt->time_tag = be64toh(pkt_hdr->time_tag); + pkt->decimation = be32toh(pkt_hdr->navg); + pkt->seq = pkt->time_tag / 196000000 / (pkt->decimation / 100); + pkt->nsrc = _nsrc; + pkt->src = (stand0*(2*(nstand-1)+1-stand0)/2 + stand1 + 1 - _src0)*nserver \ + + (server - 1); + pkt->chan0 = be16toh(pkt_hdr->first_chan) \ + - nchan_decim*nchan_pkt * (server - 1); + pkt->nchan = nchan_pkt; + pkt->tuning = (nserver << 8) | (server - 1); // Stores the number of servers and + // the server that sent this packet + pkt->gain = be16toh(pkt_hdr->gain); + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + /* + if( stand0 == 0 || (stand0 == 1 && stand1 < 2) ) { + std::cout << "nsrc: " << pkt->nsrc << std::endl; + std::cout << "stand0: " << stand0 << std::endl; + std::cout << "stand1: " << stand1 << std::endl; + std::cout << "server: " << server << std::endl; + std::cout << "src: " << pkt->src << std::endl; + std::cout << "chan0: " << pkt->chan0 << std::endl; + std::cout << "nchan: " << pld_size/32 << std::endl; + std::cout << "navg: " << pkt->decimation << std::endl; + std::cout << "tuning: " << pkt->tuning << std::endl; + std::cout << "valid: " << this->valid_packet(pkt) << std::endl; + } + */ + return this->valid_packet(pkt); + } +}; + +class CORProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef unaligned256_type itype; // 32+32 * 4 pol. products + typedef aligned256_type otype; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + // Convenience + int bl_server = pkt->src; + int nchan = pkt->nchan; + + int chan = 0; + for( ; chan(hdr); + memset(header, 0, sizeof(cor_hdr_type)); + + // Find the number of antennas needed to reach this number of baselines + int N = (sqrt(8*hdr_base->nsrc+1) - 1) / 2; + + // Find the indices of the two stands that form this baseline + int b = 2 + 2*(N-1)+1; + int stand0 = (b - sqrt(b*b-8*hdr_base->src)) / 2; + int stand1 = hdr_base->src - stand0*(2*(N-1)+1-stand0)/2; + + header->sync_word = 0x5CDEC0DE; + // Bits 9-32 are the server identifier; bits 1-8 are the COR packet flag + header->frame_count_word = htobe32((hdr_base->tuning & 0xFFFFFF) \ + | ((uint32_t) 0x02 << 24)); + header->first_chan = htons(hdr_base->chan0); + header->gain = htons(hdr_base->gain); + header->time_tag = htobe64(hdr_base->seq); + header->navg = htobe32(hdr_base->decimation); + header->stand0 = htons(stand0 + 1); + header->stand1 = htons(stand1 + 1); + } +}; diff --git a/src/formats/drx.hpp b/src/formats/drx.hpp new file mode 100644 index 000000000..55ad4406e --- /dev/null +++ b/src/formats/drx.hpp @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +#define DRX_FRAME_SIZE 4128 + +struct __attribute__((packed)) drx_hdr_type { + uint32_t sync_word; + uint32_t frame_count_word; + uint32_t seconds_count; + uint16_t decimation; + uint16_t time_offset; + uint64_t time_tag; + uint32_t tuning_word; + uint32_t flags; +}; + +class DRXDecoder : virtual public PacketDecoder { + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->sync == 0x5CDEC0DE && + pkt->src >= 0 && + pkt->src < _nsrc && + pkt->time_tag >= 0 && + (((_nsrc == 4) && + (pkt->tuning > 0 && + pkt->tuning1 > 0)) || + (_nsrc == 2 && + (pkt->tuning > 0 || + pkt->tuning1 > 0))) && + pkt->valid_mode == 0); + } +public: + DRXDecoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size != DRX_FRAME_SIZE ) { + return false; + } + const drx_hdr_type* pkt_hdr = (drx_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(drx_hdr_type); + int pld_size = pkt_size - sizeof(drx_hdr_type); + int pkt_id = pkt_hdr->frame_count_word & 0xFF; + pkt->beam = (pkt_id & 0x7) - 1; + int pkt_tune = ((pkt_id >> 3) & 0x7) - 1; + int pkt_pol = ((pkt_id >> 7) & 0x1); + pkt_id = (pkt_tune << 1) | pkt_pol; + pkt->sync = pkt_hdr->sync_word; + pkt->time_tag = be64toh(pkt_hdr->time_tag) - be16toh(pkt_hdr->time_offset); + pkt->seq = pkt->time_tag / be16toh(pkt_hdr->decimation) / 4096; + pkt->nsrc = _nsrc; + pkt->src = pkt_id - _src0; + if( pkt->src / 2 == 0 ) { + pkt->tuning = be32toh(pkt_hdr->tuning_word); + } else { + pkt->tuning1 = be32toh(pkt_hdr->tuning_word); + } + pkt->decimation = be16toh(pkt_hdr->decimation); + pkt->valid_mode = ((pkt_id >> 6) & 0x1); + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + return this->valid_packet(pkt); + } +}; + + +class DRXProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + uint8_t const* __restrict__ in = (uint8_t const*)pkt->payload_ptr; + uint8_t* __restrict__ out = (uint8_t* )&obufs[obuf_idx][obuf_offset]; + + for( int samp=0; samp<4096; ++samp ) { // HACK TESTING + *(out + pkt->src) = *in; + in++; + out += pkt->nsrc; + } + } + + inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) { + uint8_t* __restrict__ aligned_data = (uint8_t*) data; + for( int t=0; t(hdr); + memset(header, 0, sizeof(drx_hdr_type)); + + header->sync_word = 0x5CDEC0DE; + // ID is stored in the lowest 8 bits; bit 2 is reserved + header->frame_count_word = htobe32((uint32_t) (hdr_base->src & 0xBF) << 24); + header->decimation = htobe16((uint16_t) hdr_base->decimation); + header->time_offset = 0; + header->time_tag = htobe64(hdr_base->seq); + header->tuning_word = htobe32(hdr_base->tuning); + } +}; diff --git a/src/formats/drx8.hpp b/src/formats/drx8.hpp new file mode 100644 index 000000000..cf1f38289 --- /dev/null +++ b/src/formats/drx8.hpp @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +#define DRX8_FRAME_SIZE 8224 + +struct __attribute__((packed)) drx8_hdr_type { + uint32_t sync_word; + uint32_t frame_count_word; + uint32_t seconds_count; + uint16_t decimation; + uint16_t time_offset; + uint64_t time_tag; + uint32_t tuning_word; + uint32_t flags; +}; + +class DRX8Decoder : virtual public PacketDecoder { + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->sync == 0x5CDEC0DE && + pkt->src >= 0 && + pkt->src < _nsrc && + pkt->time_tag >= 0 && + (((_nsrc == 4) && + (pkt->tuning > 0 && + pkt->tuning1 > 0)) || + (_nsrc == 2 && + (pkt->tuning > 0 || + pkt->tuning1 > 0))) && + pkt->valid_mode == 0); + } +public: + DRX8Decoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size != DRX_FRAME_SIZE ) { + return false; + } + const drx8_hdr_type* pkt_hdr = (drx8_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(drx8_hdr_type); + int pld_size = pkt_size - sizeof(drx8_hdr_type); + int pkt_id = pkt_hdr->frame_count_word & 0xFF; + pkt->beam = (pkt_id & 0x7) - 1; + int pkt_tune = ((pkt_id >> 3) & 0x7) - 1; + int pkt_pol = ((pkt_id >> 7) & 0x1); + pkt_id = (pkt_tune << 1) | pkt_pol; + pkt->sync = pkt_hdr->sync_word; + pkt->time_tag = be64toh(pkt_hdr->time_tag) - be16toh(pkt_hdr->time_offset); + pkt->seq = pkt->time_tag / be16toh(pkt_hdr->decimation) / 4096; + pkt->nsrc = _nsrc; + pkt->src = pkt_id - _src0; + if( pkt->src / 2 == 0 ) { + pkt->tuning = be32toh(pkt_hdr->tuning_word); + } else { + pkt->tuning1 = be32toh(pkt_hdr->tuning_word); + } + pkt->decimation = be16toh(pkt_hdr->decimation); + pkt->valid_mode = ((pkt_id >> 6) & 0x1); + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + return this->valid_packet(pkt); + } +}; + + +class DRX8Processor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + uint16_t const* __restrict__ in = (uint16_t const*)pkt->payload_ptr; + uint16_t* __restrict__ out = (uint16_t* )&obufs[obuf_idx][obuf_offset]; + + for( int samp=0; samp<4096; ++samp ) { // HACK TESTING + *(out + pkt->src) = *in; + in++; + out += pkt->nsrc; + } + } + + inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) { + uint16_t* __restrict__ aligned_data = (uint16_t*) data; + for( int t=0; t(hdr); + memset(header, 0, sizeof(drx8_hdr_type)); + + header->sync_word = 0x5CDEC0DE; + // ID is stored in the lowest 8 bits; bit 2 is reserved for DRX8 vs DRX + header->frame_count_word = htobe32((uint32_t) ((hdr_base->src & 0xBF) | 0x40) << 24); + header->decimation = htobe16((uint16_t) hdr_base->decimation); + header->time_offset = 0; + header->time_tag = htobe64(hdr_base->seq); + header->tuning_word = htobe32(hdr_base->tuning); + } +}; diff --git a/src/formats/formats.hpp b/src/formats/formats.hpp new file mode 100644 index 000000000..8f30468e5 --- /dev/null +++ b/src/formats/formats.hpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019-2024, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "chips.hpp" +#include "cor.hpp" +#include "vdif.hpp" +#include "drx.hpp" +#include "drx8.hpp" +#include "tbn.hpp" +#include "tbf.hpp" +#include "ibeam.hpp" +#include "snap2.hpp" +#include "pbeam.hpp" +#include "simple.hpp" +#include "vbeam.hpp" diff --git a/src/formats/ibeam.hpp b/src/formats/ibeam.hpp new file mode 100644 index 000000000..02c5fd9cb --- /dev/null +++ b/src/formats/ibeam.hpp @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +//#include // SSE + +struct __attribute__((packed)) ibeam_hdr_type { + uint8_t server; // Note: 1-based + uint8_t gbe; // (AKA tuning) + uint8_t nchan; // 109 + uint8_t nbeam; // 2 + uint8_t nserver; // 6 + // Note: Big endian + uint16_t chan0; // First chan in packet + uint64_t seq; // Note: 1-based +}; + +template +class IBeamDecoder: virtual public PacketDecoder { + uint8_t _nbeam = B; + + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->seq >= 0 && + pkt->src >= 0 && pkt->src < _nsrc && + pkt->beam == _nbeam && + pkt->chan0 >= 0); + } +public: + IBeamDecoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(ibeam_hdr_type) ) { + return false; + } + const ibeam_hdr_type* pkt_hdr = (ibeam_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(ibeam_hdr_type); + int pld_size = pkt_size - sizeof(ibeam_hdr_type); + pkt->seq = be64toh(pkt_hdr->seq) - 1; + //pkt->nsrc = pkt_hdr->nserver; + pkt->nsrc = _nsrc; + pkt->src = (pkt_hdr->server - 1) - _src0; + pkt->beam = pkt_hdr->nbeam; + pkt->nchan = pkt_hdr->nchan; + pkt->chan0 = ntohs(pkt_hdr->chan0) - pkt->nchan * pkt->src; + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + return this->valid_packet(pkt); + } +}; + +template +class IBeamProcessor : virtual public PacketProcessor { + uint8_t _nbeam = B; + +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size * BF_UNPACK_FACTOR; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + // **CHANGED RECENTLY + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef unaligned128_type itype; // cf32 * 1 beam * 2 pol + typedef aligned128_type otype; + + obuf_offset *= BF_UNPACK_FACTOR; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + int chan, beam; + for(chan=0; channchan; ++chan ) { + for(beam=0; beam<_nbeam; ++beam) { +#if defined BF_SSE_ENABLED && BF_SSE_ENABLED + const unaligned128_type* dsrc = (const unaligned128_type*) &in[chan*_nbeam + beam]; + aligned128_type* ddst = (aligned128_type*) &out[pkt->src*pkt->nchan*_nbeam + chan*_nbeam + beam]; + + __m128i mtemp = _mm_loadu_si128(reinterpret_cast(dsrc)); + _mm_stream_si128(reinterpret_cast<__m128i*>(ddst), mtemp); +#else + ::memcpy(&out[pkt->src*pkt->nchan*_nbeam + chan*_nbeam + beam], + &in[chan*_nbeam + beam], sizeof(otype)); + //out[pkt->src*pkt->nchan*_nbeam + chan*_nbeam + beam] = in[chan*_nbeam + beam]; +#endif + } + } + } + + inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) { + typedef aligned128_type otype; + otype* __restrict__ aligned_data = (otype*)data; + for( int t=0; t(ddst), mtemp); +#else + ::memset(&aligned_data[t*nsrc*nchan*_nbeam + src*nchan*_nbeam + c*_nbeam + b], + 0, sizeof(otype)); +#endif + } + } + } + } +}; + +template +class IBeamHeaderFiller : virtual public PacketHeaderFiller { + uint8_t _nbeam = B; + +public: + inline int get_size() { return sizeof(ibeam_hdr_type); } + inline void operator()(const PacketDesc* hdr_base, + BFoffset framecount, + char* hdr) { + ibeam_hdr_type* header = reinterpret_cast(hdr); + memset(header, 0, sizeof(ibeam_hdr_type)); + + header->server = hdr_base->src + 1; + header->gbe = hdr_base->tuning; + header->nchan = hdr_base->nchan; + header->nbeam = _nbeam; + header->nserver = hdr_base->nsrc; + header->chan0 = htons(hdr_base->chan0); + header->seq = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/pbeam.hpp b/src/formats/pbeam.hpp new file mode 100644 index 000000000..91d644b59 --- /dev/null +++ b/src/formats/pbeam.hpp @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2020, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +//#include // SSE + +struct __attribute__((packed)) pbeam_hdr_type { + uint8_t server; // Note: 1-based + uint8_t beam; // Note: 1-based + uint8_t gbe; // (AKA tuning) + uint8_t nchan; // 109 + uint8_t nbeam; // 2 + uint8_t nserver; // 6 + // Note: Big endian + uint16_t navg; // Number of raw spectra averaged + uint16_t chan0; // First chan in packet + uint64_t seq; // Note: 1-based +}; + +class PBeamDecoder: virtual public PacketDecoder { + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->seq >= 0 && + pkt->src >= 0 && pkt->src < _nsrc && + pkt->chan0 >= 0); + } +public: + PBeamDecoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(pbeam_hdr_type) ) { + return false; + } + const pbeam_hdr_type* pkt_hdr = (pbeam_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(pbeam_hdr_type); + int pld_size = pkt_size - sizeof(pbeam_hdr_type); + pkt->decimation = be16toh(pkt_hdr->navg); + pkt->time_tag = be64toh(pkt_hdr->seq); + pkt->seq = pkt->time_tag / pkt->decimation; + //pkt->nsrc = pkt_hdr->nserver; + pkt->nsrc = _nsrc; + pkt->src = (pkt_hdr->beam - _src0) * pkt_hdr->nserver + (pkt_hdr->server - 1); + pkt->beam = pkt_hdr->nbeam; + pkt->nchan = pkt_hdr->nchan; + pkt->chan0 = ntohs(pkt_hdr->chan0) - pkt->nchan * pkt->src; + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + return this->valid_packet(pkt); + } +}; + +class PBeamProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size * BF_UNPACK_FACTOR; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + // **CHANGED RECENTLY + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef unaligned128_type itype; // f32 * 1 beam * 4 pol (XX, YY, R(XY), I(XY)) + typedef aligned128_type otype; + + obuf_offset *= BF_UNPACK_FACTOR; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + // Convenience + int beam_server = pkt->src; + int nchan = pkt->nchan; + + int chan; + for(chan=0; chan(dsrc)); + _mm_stream_si128(reinterpret_cast<__m128i*>(ddst), mtemp); +#else + ::memcpy(&out[beam_server*nchan + chan], &in[chan], sizeof(otype)); +#endif + } + } + + inline void blank_out_source(uint8_t* data, + int src, // beam_server + int nsrc, // nbeam_server + int nchan, + int nseq) { + typedef aligned128_type otype; + otype* __restrict__ aligned_data = (otype*)data; + for( int t=0; t(ddst), mtemp); +#else + ::memset(&aligned_data[t*nsrc*nchan + src*nchan], + 0, nchan*sizeof(otype)); +#endif + } + } +}; + +template +class PBeamHeaderFiller : virtual public PacketHeaderFiller { + uint8_t _nbeam = B; + +public: + inline int get_size() { return sizeof(pbeam_hdr_type); } + inline void operator()(const PacketDesc* hdr_base, + BFoffset framecount, + char* hdr) { + pbeam_hdr_type* header = reinterpret_cast(hdr); + memset(header, 0, sizeof(pbeam_hdr_type)); + + int nserver = hdr_base->nsrc / _nbeam; + + header->server = (hdr_base->src % nserver) + 1; // Modulo? + header->beam = (hdr_base->src / nserver) + 1; + header->gbe = hdr_base->tuning; + header->nchan = hdr_base->nchan; + header->nbeam = _nbeam; + header->nserver = nserver; + header->navg = htons((uint16_t) hdr_base->decimation); + header->chan0 = htons((uint16_t) hdr_base->chan0); + header->seq = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/simple.hpp b/src/formats/simple.hpp new file mode 100644 index 000000000..98f4f244d --- /dev/null +++ b/src/formats/simple.hpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +struct __attribute__((packed)) simple_hdr_type { + uint64_t seq; +}; + +class SIMPLEDecoder : virtual public PacketDecoder { + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->seq >= 0 ); + } +public: + SIMPLEDecoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(simple_hdr_type) ) { + return false; + } + const simple_hdr_type* pkt_hdr = (simple_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(simple_hdr_type); + int pld_size = pkt_size - sizeof(simple_hdr_type); + pkt->seq = be64toh(pkt_hdr->seq); + pkt->nsrc = 1; + pkt->src = 0; + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + pkt->nchan = 1; + pkt->chan0 = 0; + return this->valid_packet(pkt); + } +}; + +class SIMPLEProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size * BF_UNPACK_FACTOR; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][0] += nbyte; + // **CHANGED RECENTLY + int payload_size = pkt->payload_size;//pkt->nchan*(PKT_NINPUT*2*PKT_NBIT/8); + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef unaligned256_type itype; + typedef aligned256_type otype; + + obuf_offset *= BF_UNPACK_FACTOR; + + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + int chan = 0; + int nelem = 256; + for( ; chan(hdr); + memset(header, 0, sizeof(simple_hdr_type)); + + header->seq = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/snap2.hpp b/src/formats/snap2.hpp new file mode 100644 index 000000000..a1150727a --- /dev/null +++ b/src/formats/snap2.hpp @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +// All entries are network (i.e. big) endian +struct __attribute__((packed)) snap2_hdr_type { + uint64_t seq; // Spectra counter == packet counter + uint32_t sync_time; // UNIX sync time + uint16_t npol; // Number of pols in this packet + uint16_t npol_tot; // Number of pols total + uint16_t nchan; // Number of channels in this packet + uint16_t nchan_tot; // Number of channels total (for this pipeline) + uint32_t chan_block_id; // ID of this block of chans + uint32_t chan0; // First channel in this packet + uint32_t pol0; // First pol in this packet +}; + +/* + * The PacketDecoder's job is to unpack + * a packet into a standard PacketDesc + * format, and verify that a packet + * is valid. + */ + +#define BF_SNAP2_DEBUG 0 + +class SNAP2Decoder : virtual public PacketDecoder { +protected: + inline bool valid_packet(const PacketDesc* pkt) const { +//#if BF_SNAP2_DEBUG +// cout << "seq: "<< pkt->seq << endl; +// cout << "src: "<< pkt->src << endl; +// cout << "nsrc: "<< pkt->nsrc << endl; +// cout << "nchan: "<< pkt->nchan << endl; +// cout << "chan0: "<< pkt->chan0 << endl; +//#endif + return ( + pkt->seq >= 0 + && pkt->src >= 0 + && pkt->src < _nsrc + && pkt->nsrc == _nsrc + && pkt->chan0 >= 0 + ); + } +public: + SNAP2Decoder(int nsrc, int src0) : PacketDecoder(nsrc, src0) {} + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(snap2_hdr_type) ) { + return false; + } + const snap2_hdr_type* pkt_hdr = (snap2_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(snap2_hdr_type); + int pld_size = pkt_size - sizeof(snap2_hdr_type); + pkt->seq = be64toh(pkt_hdr->seq); + pkt->time_tag = be32toh(pkt_hdr->sync_time); +#if BF_SNAP2_DEBUG + fprintf(stderr, "seq: %lu\t", pkt->seq); + fprintf(stderr, "sync_time: %lu\t", pkt->time_tag); + fprintf(stderr, "nchan: %lu\t", be16toh(pkt_hdr->nchan)); + fprintf(stderr, "npol: %lu\t", be16toh(pkt_hdr->npol)); +#endif + int npol_blocks = (be16toh(pkt_hdr->npol_tot) / be16toh(pkt_hdr->npol)); + int nchan_blocks = (be16toh(pkt_hdr->nchan_tot) / be16toh(pkt_hdr->nchan)); + + pkt->tuning = be32toh(pkt_hdr->chan0); // Abuse this so we can use chan0 to reference channel within pipeline + pkt->nsrc = npol_blocks * nchan_blocks;// _nsrc; + pkt->nchan = be16toh(pkt_hdr->nchan); + pkt->chan0 = be32toh(pkt_hdr->chan_block_id) * be16toh(pkt_hdr->nchan); + pkt->nchan_tot = be16toh(pkt_hdr->nchan_tot); + pkt->npol = be16toh(pkt_hdr->npol); + pkt->npol_tot = be16toh(pkt_hdr->npol_tot); + pkt->pol0 = be32toh(pkt_hdr->pol0); + pkt->src = (pkt->pol0 / pkt->npol) + be32toh(pkt_hdr->chan_block_id) * npol_blocks; + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; +#if BF_SNAP2_DEBUG + fprintf(stderr, "nsrc: %lu\t", pkt->nsrc); + fprintf(stderr, "src: %lu\t", pkt->src); + fprintf(stderr, "chan0: %lu\t", pkt->chan0); + fprintf(stderr, "chan_block_id: %lu\t", be32toh(pkt_hdr->chan_block_id)); + fprintf(stderr, "nchan_tot: %lu\t", pkt->nchan_tot); + fprintf(stderr, "npol_tot: %lu\t", pkt->npol_tot); + fprintf(stderr, "pol0: %lu\n", pkt->pol0); +#endif + return this->valid_packet(pkt); + } +}; + +class SNAP2Processor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size * BF_UNPACK_FACTOR; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef unaligned256_type itype; //256 bits = 32 pols / word + typedef aligned256_type otype; + + obuf_offset *= BF_UNPACK_FACTOR; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + int words_per_chan_out = pkt->npol_tot >> 5; + int pol_offset_out = pkt->pol0 >> 5; + int pkt_chan = pkt->chan0; // The first channel in this packet + + // Copy packet payload one channel at a time. + // Packets have payload format nchans x npols x complexity. + // Output buffer order is chans * npol_total * complexity + // Spacing with which channel chunks are copied depends + // on the total number of channels/pols in the system + int c=0; +#if defined BF_AVX_ENABLED && BF_AVX_ENABLED + __m256i *dest_p; + __m256i vecbuf[2]; + uint64_t *in64 = (uint64_t *)in; + dest_p = (__m256i *)(out + (words_per_chan_out * (pkt_chan)) + pol_offset_out); +#endif + //if((pol_offset_out == 0) && (pkt_chan==0) && ((pkt->seq % 120)==0) ){ + // fprintf(stderr, "nsrc: %d seq: %d, dest_p: %p obuf idx %d, obuf offset %lu, nseq_per_obuf %d, seq0 %d, nbuf: %d\n", pkt->nsrc, pkt->seq, dest_p, obuf_idx, obuf_offset, nseq_per_obuf, seq0, nbuf); + //} + for(c=0; cnchan; c++) { +#if defined BF_AVX_ENABLED && BF_AVX_ENABLED + vecbuf[0] = _mm256_set_epi64x(in64[3], in64[2], in64[1], in64[0]); + vecbuf[1] = _mm256_set_epi64x(in64[7], in64[6], in64[5], in64[4]); + _mm256_stream_si256(dest_p, vecbuf[0]); + _mm256_stream_si256(dest_p+1, vecbuf[1]); + in64 += 8; + dest_p += words_per_chan_out; +#else + ::memcpy(&out[pkt->src + pkt->nsrc*c], + &in[c], sizeof(otype)); +#endif + } + } + + inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) { + typedef aligned256_type otype; + otype* __restrict__ aligned_data = (otype*)data; + for( int t=0; t(hdr); + memset(header, 0, sizeof(snap2_hdr_type)); + + header->seq = htobe64(hdr_base->seq); + header->npol = 2; + header->npol_tot = 2; + header->nchan = hdr_base->nchan; + header->nchan_tot = hdr_base->nchan * hdr_base->nsrc; + header->chan_block_id = hdr_base->src; + header->chan0 = htons(hdr_base->chan0); + header->pol0 = 0; + + } +}; diff --git a/src/formats/tbf.hpp b/src/formats/tbf.hpp new file mode 100644 index 000000000..af90066ce --- /dev/null +++ b/src/formats/tbf.hpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +struct __attribute__((packed)) tbf_hdr_type { + uint32_t sync_word; + uint32_t frame_count_word; + uint32_t seconds_count; + uint16_t first_chan; + uint16_t nstand; + uint64_t time_tag; +}; + +class TBFHeaderFiller : virtual public PacketHeaderFiller { +public: + inline int get_size() { return sizeof(tbf_hdr_type); } + inline void operator()(const PacketDesc* hdr_base, + BFoffset framecount, + char* hdr) { + tbf_hdr_type* header = reinterpret_cast(hdr); + memset(header, 0, sizeof(tbf_hdr_type)); + + header->sync_word = 0x5CDEC0DE; + // Bits 9-32 are the frame count; bits 1-8 are the TBF packet flag + header->frame_count_word = htobe32((framecount & 0xFFFFFF) \ + | ((uint32_t) 0x01 << 24)); + header->first_chan = htons(hdr_base->src); + header->nstand = htobe16(hdr_base->nsrc); + header->time_tag = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/tbn.hpp b/src/formats/tbn.hpp new file mode 100644 index 000000000..2a805c41f --- /dev/null +++ b/src/formats/tbn.hpp @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +#define TBN_FRAME_SIZE 1048 + +struct __attribute__((packed)) tbn_hdr_type { + uint32_t sync_word; + uint32_t frame_count_word; + uint32_t tuning_word; + uint16_t tbn_id; + uint16_t gain; + uint64_t time_tag; +}; + +class TBNCache { + uint64_t _timestamp_last = 0; + int _pid_last = -1000; + uint16_t _decimation = 1; + bool _active = false; +public: + TBNCache() {} + inline uint16_t get_decimation() { return _decimation; } + inline bool update(int packet_id, + uint64_t timestamp) { + if( !_active ) { + if( packet_id == _pid_last ) { + _decimation = ((timestamp - _timestamp_last) / 512); + _active = true; + } else if( _pid_last == -1000 ) { + _pid_last = packet_id; + _timestamp_last = timestamp; + } + } + return _active; + } +}; + +class TBNDecoder : virtual public PacketDecoder { + TBNCache* _cache; + + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->sync == 0x5CDEC0DE && + pkt->src >= 0 && + pkt->src < _nsrc && + pkt->time_tag >= 0 && + pkt->tuning >= 0 && + pkt->valid_mode == 0); + } +public: + TBNDecoder(int nsrc, int src0) + : PacketDecoder(nsrc, src0) { + _cache = new TBNCache(); + } + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size != TBN_FRAME_SIZE ) { + return false; + } + const tbn_hdr_type* pkt_hdr = (tbn_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(tbn_hdr_type); + int pld_size = pkt_size - sizeof(tbn_hdr_type); + pkt->sync = pkt_hdr->sync_word; + pkt->time_tag = be64toh(pkt_hdr->time_tag); + pkt->nsrc = _nsrc; + pkt->src = (be16toh(pkt_hdr->tbn_id) & 1023) - 1 - _src0; + pkt->tuning = be32toh(pkt_hdr->tuning_word); + pkt->valid_mode = (be16toh(pkt_hdr->tbn_id) >> 15) & 1; + pkt->gain = (be16toh(pkt_hdr->gain)); + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + bool valid = this->valid_packet(pkt); + if( valid ) { + valid &= _cache->update(pkt->src, pkt->time_tag); + pkt->decimation = _cache->get_decimation(); + pkt->seq = pkt->time_tag / pkt->decimation / 512; + } + return valid; + } +}; + +class TBNProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + uint16_t const* __restrict__ in = (uint16_t const*)pkt->payload_ptr; + uint16_t* __restrict__ out = (uint16_t* )&obufs[obuf_idx][obuf_offset]; + + int samp = 0; + for( ; samp<512; ++samp ) { // HACK TESTING + out[samp*pkt->nsrc + pkt->src] = in[samp]; + } + } + + inline void blank_out_source(uint8_t* data, + int src, + int nsrc, + int nchan, + int nseq) { + uint16_t* __restrict__ aligned_data = (uint16_t*)data; + for( int t=0; t(hdr); + memset(header, 0, sizeof(tbn_hdr_type)); + + header->sync_word = 0x5CDEC0DE; + // Bits 9-32 are the frame count; bits 1-8 are zero + header->frame_count_word = htobe32((framecount & 0xFFFFFF)); + header->tuning_word = htobe32(hdr_base->tuning); + // ID is the upper 14 bits; bit 2 is reserved; bit 1 is the TBW flag + header->tbn_id = htons((hdr_base->src + 1) & 0x3FFF); + header->gain = htons(hdr_base->gain); + header->time_tag = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/vbeam.hpp b/src/formats/vbeam.hpp new file mode 100644 index 000000000..29f98d749 --- /dev/null +++ b/src/formats/vbeam.hpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +struct __attribute__((packed)) vbeam_hdr_type { + uint64_t sync_word; + uint64_t sync_time; + uint64_t time_tag; + double bw_hz; + double sfreq; + uint32_t nchan; + uint32_t chan0; + uint32_t npol; +}; + +class VBeamHeaderFiller : virtual public PacketHeaderFiller { +public: + inline int get_size() { return sizeof(vbeam_hdr_type); } + inline void operator()(const PacketDesc* hdr_base, + BFoffset framecount, + char* hdr) { + vbeam_hdr_type* header = reinterpret_cast(hdr); + memset(header, 0, sizeof(vbeam_hdr_type)); + + header->sync_word = 0xAABBCCDD00000000L; + header->time_tag = htobe64(hdr_base->seq); + } +}; diff --git a/src/formats/vdif.hpp b/src/formats/vdif.hpp new file mode 100644 index 000000000..ef0bd8f16 --- /dev/null +++ b/src/formats/vdif.hpp @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2019, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "base.hpp" + +struct __attribute__((packed)) vdif_hdr_type { + struct __attribute__((packed)) word_1_ { + uint32_t seconds_from_epoch:30; + uint8_t is_legacy:1; + uint8_t is_invalid:1; + } word_1; + struct __attribute__((packed)) word_2_ { + uint32_t frame_in_second:24; + uint16_t ref_epoch:6; + uint8_t unassigned:2; + } word_2; + struct __attribute__((packed)) word_3_ { + uint32_t frame_length:24; + uint32_t log2_nchan:5; + uint8_t version:3; + } word_3; + struct __attribute__((packed)) word_4_ { + uint16_t station_id:16; + uint16_t thread_id:10; + uint8_t bits_per_sample_minus_one:5; + uint8_t is_complex:1; + } word_4; +}; + +struct __attribute__((packed)) vdif_ext_type { + uint32_t extended_word_1; + uint32_t extended_word_2; + uint32_t extended_word_3; + uint32_t extended_word_4; +}; + +class VDIFCache { + BFoffset _frame_last = 0; + uint32_t _frames_per_second = 0; + uint32_t _sample_rate = 0; + bool _active = false; +public: + VDIFCache() {} + inline uint32_t get_frames_per_second() { return _frames_per_second; } + inline uint32_t get_sample_rate() { return _sample_rate; } + inline bool update(uint32_t seconds_from_epoch, + uint32_t frame_in_second, + uint32_t samples_per_frame) { + if( !_active ) { + if( frame_in_second < _frame_last ) { + _frames_per_second = _frame_last + 1; + _sample_rate = _frames_per_second * samples_per_frame; + _active = true; + } + _frame_last = frame_in_second; + } + return _active; + } +}; + +class VDIFDecoder : virtual public PacketDecoder { + VDIFCache* _cache; + + inline bool valid_packet(const PacketDesc* pkt) const { + return (pkt->src >= 0 && + pkt->src < _nsrc && + pkt->valid_mode == 0); + } +public: + VDIFDecoder(int nsrc, int src0) + : PacketDecoder(nsrc, src0) { + _cache = new VDIFCache(); + } + inline bool operator()(const uint8_t* pkt_ptr, + int pkt_size, + PacketDesc* pkt) const { + if( pkt_size < (int)sizeof(vdif_hdr_type) ) { + return false; + } + const vdif_hdr_type* pkt_hdr = (vdif_hdr_type*)pkt_ptr; + const uint8_t* pkt_pld = pkt_ptr + sizeof(vdif_hdr_type); + int pld_size = pkt_size - sizeof(vdif_hdr_type); + if( pkt_hdr->word_1.is_legacy == 0 ) { + // Do not try to decode the extended header entries + pkt_pld += sizeof(vdif_ext_type); + pld_size -= sizeof(vdif_ext_type); + } + + uint32_t nsamples = pld_size * 8 \ + / (pkt_hdr->word_4.bits_per_sample_minus_one + 1) \ + / ((int) 1 << pkt_hdr->word_3.log2_nchan) \ + / (1 + pkt_hdr->word_4.is_complex); + bool is_active = _cache->update(pkt_hdr->word_1.seconds_from_epoch, + pkt_hdr->word_2.frame_in_second, + nsamples); + + pkt->seq = (BFoffset) pkt_hdr->word_1.seconds_from_epoch*_cache->get_frames_per_second() \ + + (BFoffset) pkt_hdr->word_2.frame_in_second; + pkt->time_tag = pkt->seq*_cache->get_sample_rate(); + pkt->src = pkt_hdr->word_4.thread_id - _src0; + pkt->nsrc = _nsrc; + pkt->chan0 = (int) 1 << pkt_hdr->word_3.log2_nchan; + pkt->nchan = pld_size / 8; + pkt->sync = _cache->get_sample_rate(); + pkt->tuning = (((int) pkt_hdr->word_2.ref_epoch) << 16) \ + | (((int) pkt_hdr->word_4.bits_per_sample_minus_one + 1) << 8) \ + | pkt_hdr->word_4.is_complex; + pkt->valid_mode = pkt_hdr->word_1.is_invalid || (not is_active); + pkt->payload_size = pld_size; + pkt->payload_ptr = pkt_pld; + /* + if( this->valid_packet(pkt) && (pkt_hdr->word_2.frame_in_second == 1) ) { + std::cout << "pld_size: " << pld_size << std::endl; + std::cout << " : " << pkt_hdr->word_3.frame_length*8 - 32 + 16*pkt_hdr->word_1.is_legacy<< std::endl; + std::cout << "seconds_from_epoch: " << pkt_hdr->word_1.seconds_from_epoch << std::endl; + std::cout << "frame_in_second: " << pkt_hdr->word_2.frame_in_second << std::endl; + std::cout << "frames_per_second: " << _cache->get_frames_per_second() << std::endl; + std::cout << "sample_rate: " << _cache->get_sample_rate() << std::endl; + std::cout << "src: " << pkt->src << std::endl; + std::cout << "is_legacy: " << pkt_hdr->word_1.is_legacy << std::endl; + std::cout << "valid: " << this->valid_packet(pkt) << std::endl; + } + */ + return this->valid_packet(pkt); + } +}; + +class VDIFProcessor : virtual public PacketProcessor { +public: + inline void operator()(const PacketDesc* pkt, + uint64_t seq0, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t ngood_bytes[], + size_t* src_ngood_bytes[]) { + int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + + (pkt->seq - seq0 >= 2*nseq_per_obuf)); + size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; + size_t nbyte = pkt->payload_size; + ngood_bytes[obuf_idx] += nbyte; + src_ngood_bytes[obuf_idx][pkt->src] += nbyte; + int payload_size = pkt->payload_size; + + size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; + typedef uint64_t itype; // 8-byte chunks in the file + typedef uint64_t otype; + + // Note: Using these SSE types allows the compiler to use SSE instructions + // However, they require aligned memory (otherwise segfault) + itype const* __restrict__ in = (itype const*)pkt->payload_ptr; + otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; + + // Convenience + int src = pkt->src; + int nchan = pkt->nchan; + + int chan = 0; + for( ; chan + +#if BF_HWLOC_ENABLED +int HardwareLocality::get_numa_node_of_core(int core) { + int core_depth = hwloc_get_type_or_below_depth(_topo, HWLOC_OBJ_PU); + int ncore = hwloc_get_nbobjs_by_depth(_topo, core_depth); + int ret = -1; + if( 0 <= core && core < ncore ) { + // Find correct processing unit (PU) for the core (which is an os_index) + hwloc_obj_t obj = NULL; + hwloc_obj_t tmp = NULL; + while( (tmp = hwloc_get_next_obj_by_type(_topo, HWLOC_OBJ_PU, tmp)) != NULL ) { + if( tmp->os_index == core ) { + obj = tmp; + break; + } + } + // Find the correct NUMA node for the PU + tmp = NULL; + while( obj != NULL && (tmp = hwloc_get_next_obj_by_type(_topo, HWLOC_OBJ_NUMANODE, tmp)) != NULL ) { + if( hwloc_bitmap_intersects(obj->cpuset, tmp->cpuset) ) { + ret = tmp->os_index; + break; + } + } + } + return ret; +} + +int HardwareLocality::bind_thread_memory_to_core(int core) { + int core_depth = hwloc_get_type_or_below_depth(_topo, HWLOC_OBJ_PU); + int ncore = hwloc_get_nbobjs_by_depth(_topo, core_depth); + int ret = 0; + if( 0 <= core && core < ncore ) { + // Find correct processing unit (PU) for the core (with is a os_index) + hwloc_obj_t obj = NULL; + hwloc_obj_t tmp = NULL; + while( (tmp = hwloc_get_next_obj_by_type(_topo, HWLOC_OBJ_PU, tmp)) != NULL ) { + if( tmp->os_index == core ) { + obj = tmp; + break; + } + } + if( obj != NULL ) { +#if HWLOC_API_VERSION >= 0x00020000 + hwloc_cpuset_t cpuset = hwloc_bitmap_dup(obj->cpuset); + if( !hwloc_bitmap_intersects(cpuset, hwloc_topology_get_allowed_cpuset(_topo)) ) { + throw std::runtime_error("requested core is not in the list of allowed cores"); + } +#else + hwloc_cpuset_t cpuset = hwloc_bitmap_dup(obj->allowed_cpuset); +#endif + hwloc_bitmap_singlify(cpuset); // Avoid hyper-threads + hwloc_membind_policy_t policy = HWLOC_MEMBIND_BIND; + hwloc_membind_flags_t flags = HWLOC_MEMBIND_THREAD; + ret = hwloc_set_membind(_topo, cpuset, policy, flags); + hwloc_bitmap_free(cpuset); + } + } + return ret; +} + +int HardwareLocality::bind_memory_area_to_numa_node(const void* addr, size_t size, int node) { + int nnode = hwloc_get_nbobjs_by_type(_topo, HWLOC_OBJ_NUMANODE); + int ret = -1; + if( 0 <= node && node < nnode ) { + // Find correct NUMA node for the node (which is an os_index) + hwloc_obj_t obj = NULL; + hwloc_obj_t tmp = NULL; + while( (tmp = hwloc_get_next_obj_by_type(_topo, HWLOC_OBJ_NUMANODE, tmp)) != NULL ) { + if( tmp->os_index == node ) { + obj = tmp; + break; + } + } + if( obj != NULL ) { + #if HWLOC_API_VERSION >= 0x00020000 + hwloc_cpuset_t cpuset = hwloc_bitmap_dup(obj->nodeset); + #else + hwloc_cpuset_t cpuset = hwloc_bitmap_dup(obj->allowed_cpuset); + #endif + hwloc_bitmap_singlify(cpuset); // Avoid hyper-threads + hwloc_membind_policy_t policy = HWLOC_MEMBIND_BIND; + hwloc_membind_flags_t flags = HWLOC_MEMBIND_THREAD; + ret = hwloc_set_area_membind(_topo, addr, size, cpuset, policy, flags); + hwloc_bitmap_free(cpuset); + } + } + return ret; +} +#endif // BF_HWLOC_ENABLED diff --git a/src/hw_locality.hpp b/src/hw_locality.hpp new file mode 100644 index 000000000..3e80be59d --- /dev/null +++ b/src/hw_locality.hpp @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2019-2022, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include +#include + +#if BF_HWLOC_ENABLED +#include +class HardwareLocality { + hwloc_topology_t _topo; + HardwareLocality(HardwareLocality const&); + HardwareLocality& operator=(HardwareLocality const&); +public: + HardwareLocality() { + hwloc_topology_init(&_topo); + hwloc_topology_load(_topo); + } + ~HardwareLocality() { + hwloc_topology_destroy(_topo); + } + int get_numa_node_of_core(int core); + int bind_thread_memory_to_core(int core); + int bind_memory_area_to_numa_node(const void* addr, size_t size, int node); +}; +#endif // BF_HWLOC_ENABLED + +class BoundThread { +#if BF_HWLOC_ENABLED + HardwareLocality _hwloc; +#endif +public: + BoundThread(int core) { + bfAffinitySetCore(core); +#if BF_HWLOC_ENABLED + assert(_hwloc.bind_thread_memory_to_core(core) == 0); +#endif + } +}; diff --git a/src/ib_verbs.hpp b/src/ib_verbs.hpp new file mode 100644 index 000000000..187f7ce0a --- /dev/null +++ b/src/ib_verbs.hpp @@ -0,0 +1,729 @@ +/* + * Copyright (c) 2020-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef BF_VERBS_NQP +#define BF_VERBS_NQP 1 +#endif + +#ifndef BF_VERBS_NPKTBUF +#define BF_VERBS_NPKTBUF 8192 +#endif + +#ifndef BF_VERBS_WCBATCH +#define BF_VERBS_WCBATCH 16 +#endif + +#define BF_VERBS_PAYLOAD_OFFSET 42 + +struct bf_ibv_recv_pkt{ + ibv_recv_wr wr; + ibv_sge sg; + uint32_t length; +}; + +struct bf_ibv_flow { + ibv_flow_attr attr; + ibv_flow_spec_eth eth; + ibv_flow_spec_ipv4 ipv4; + ibv_flow_spec_tcp_udp udp; +} __attribute__((packed)); + +struct bf_ibv { + ibv_context* ctx; + uint8_t port_num; + ibv_pd* pd; + ibv_comp_channel* cc; + ibv_cq** cq; + ibv_qp** qp; + ibv_flow** flows; + + uint8_t* mr_buf; + size_t mr_size; + ibv_mr* mr; + + bf_ibv_recv_pkt* pkt_buf; + bf_ibv_recv_pkt* pkt; + bf_ibv_recv_pkt* pkt_batch; +}; + + +class Verbs { + int _fd; + size_t _pkt_size_max; + int _timeout; + bf_ibv _verbs; + + void get_interface_name(char* name) { + sockaddr_in sin; + char ip[INET_ADDRSTRLEN]; + socklen_t len = sizeof(sin); + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + inet_ntop(AF_INET, &(sin.sin_addr), ip, INET_ADDRSTRLEN); + + // TODO: Is there a better way to find this? + char cmd[256] = {'\0'}; + char line[256] = {'\0'}; + int is_lo = 0; + sprintf(cmd, "ip route get to %s | grep dev | awk '{print $4}'", ip); + FILE* fp = popen(cmd, "r"); + if( fgets(line, sizeof(line), fp) != NULL) { + if( line[strlen(line)-1] == '\n' ) { + line[strlen(line)-1] = '\0'; + } + if( strncmp(&(line[0]), "lo", 2) == 0 ) { + is_lo = 1; + } + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-truncation" + strncpy(name, &(line[0]), IFNAMSIZ); + #pragma GCC diagnostic pop + } + pclose(fp); + + if( is_lo ) { + // TODO: Is there a way to avoid having to do this? + sprintf(cmd, "ip route show | grep %s | grep -v default | awk '{print $3}'", ip); + fp = popen(cmd, "r"); + if( fgets(line, sizeof(line), fp) != NULL) { + if( line[strlen(line)-1] == '\n' ) { + line[strlen(line)-1] = '\0'; + } + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-truncation" + strncpy(name, &(line[0]), IFNAMSIZ); + #pragma GCC diagnostic pop + } + pclose(fp); + } + } + void get_mac_address(uint8_t* mac) { + ifreq ethreq; + this->get_interface_name(&(ethreq.ifr_name[0])); + check_error(::ioctl(_fd, SIOCGIFHWADDR, ðreq), + "query interface hardware address"); + + ::memcpy(mac, (uint8_t*) ethreq.ifr_hwaddr.sa_data, 6); + } + void get_ip_address(char* ip) { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + inet_ntop(AF_INET, &(sin.sin_addr), ip, INET_ADDRSTRLEN); + } + uint16_t get_port() { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + return ntohs(sin.sin_port); + } + int get_timeout_ms() { + timeval value; + socklen_t size = sizeof(value); + check_error(::getsockopt(_fd, SOL_SOCKET, SO_RCVTIMEO, &value, &size), + "query socket timeout"); + return int(value.tv_sec*1000) + int(value.tv_usec/1000); + } + uint64_t get_interface_gid() { + uint64_t id; + uint8_t mac[6] = {0}; + uint8_t buf[8] = {0}; + this->get_mac_address(&(mac[0])); + + ::memcpy(buf, (unsigned char*) &(mac[0]), 3); + buf[0] ^= 2; // Toggle G/L bit per modified EUI-64 spec + buf[3] = 0xff; + buf[4] = 0xfe; + ::memcpy(buf+5, (unsigned char*) &(mac[3]), 3); + ::memcpy(&id, buf, 8); + return id; + } + void create_context() { + int d, p, g; + int ndev, found; + ibv_device** ibv_dev_list = NULL; + ibv_context* ibv_ctx = NULL; + ibv_device_attr_ex ibv_dev_attr; + ibv_port_attr ibv_port_attr; + union ibv_gid ibv_gid; + + // Get the interface MAC address and GID + found = 0; + uint8_t mac[6] = {0}; + this->get_mac_address(&(mac[0])); + uint64_t gid = this->get_interface_gid(); + + // Find the right device + /* Query all devices */ + ibv_dev_list = ibv_get_device_list(&ndev); + check_null(ibv_dev_list, + "ibv_get_device_list"); + + /* Interogate */ + for(d=0; dfd, F_GETFL); + check_error(::fcntl(_verbs.cc->fd, F_SETFL, flags | O_NONBLOCK), + "set receive completion channel to non-blocking"); + flags = ::fcntl(_verbs.cc->fd, F_GETFD); + check_error(::fcntl(_verbs.cc->fd, F_SETFD, flags | O_CLOEXEC), + "set receive completion channel to non-blocking"); + ::madvise(_verbs.cc, sizeof(ibv_pd), MADV_DONTFORK); + + // Setup the completion queues + _verbs.cq = (ibv_cq**) ::malloc(BF_VERBS_NQP * sizeof(ibv_cq*)); + check_null(_verbs.cq, + "allocate receive completion queues"); + ::memset(_verbs.cq, 0, BF_VERBS_NQP * sizeof(ibv_cq*)); + for(i=0; ilkey; + } + } + + // Link the work requests to receive queue + for(i=0; iget_port()); + flow.udp.mask.dst_port = 0xffff; + + // Filter on IP address in the IPv4 header + uint32_t ip; + char ip_str[INET_ADDRSTRLEN]; + this->get_ip_address(&(ip_str[0])); + inet_pton(AF_INET, &(ip_str[0]), &ip); + ::memcpy(&(flow.ipv4.val.dst_ip), &ip, 4); + ::memset(&(flow.ipv4.mask.dst_ip), 0xff, 4); + + // Filter on the destination MAC address (actual or multicast) + uint8_t mac[6] = {0}; + this->get_mac_address(&(mac[0])); + if( ((ip & 0xFF) >= 224) && ((ip & 0xFF) < 240) ) { + ETHER_MAP_IP_MULTICAST(&ip, mac); + } + ::memcpy(&flow.eth.val.dst_mac, &mac, 6); + ::memset(&flow.eth.mask.dst_mac, 0xff, 6); + + // Create the flows + _verbs.flows = (ibv_flow**) ::malloc(BF_VERBS_NQP * sizeof(ibv_flow*)); + check_null(_verbs.flows, + "allocate flows"); + ::memset(_verbs.flows, 0, BF_VERBS_NQP * sizeof(ibv_flow*)); + for(i=0; iwr.wr_id / BF_VERBS_NPKTBUF; + return ibv_post_recv(_verbs.qp[i], &recv_pkt->wr, &recv_wr_bad); + } + inline bf_ibv_recv_pkt* receive() { + int i; + int num_wce; + uint64_t wr_id; + pollfd pfd; + ibv_qp_attr qp_attr; + ibv_cq *ev_cq; + intptr_t ev_cq_ctx; + ibv_wc wc[BF_VERBS_WCBATCH]; + bf_ibv_recv_pkt *recv_head = NULL; + ibv_recv_wr *recv_tail = NULL; + + // Ensure the queue pairs are in a state suitable for receiving + for(i=0; istate) { + case IBV_QPS_RESET: // Unexpected, but maybe user reset it + qp_attr.qp_state = IBV_QPS_INIT; + qp_attr.port_num = _verbs.port_num; + if( ibv_modify_qp(_verbs.qp[i], &qp_attr, IBV_QP_STATE|IBV_QP_PORT) ) { + return NULL; + } + case IBV_QPS_INIT: + qp_attr.qp_state = IBV_QPS_RTR; + qp_attr.port_num = _verbs.port_num; + if( ibv_modify_qp(_verbs.qp[i], &qp_attr, IBV_QP_STATE) ) { + return NULL; + } + break; + case IBV_QPS_RTR: + case IBV_QPS_RTS: + break; + default: + return NULL; + } + } + + // Setup for poll + pfd.fd = _verbs.cc->fd; + pfd.events = POLLIN; + pfd.revents = 0; + + // poll completion channel's fd with given timeout + int rc = ::poll(&pfd, 1, _timeout); + if( rc == 0) { + // Timeout + errno = EAGAIN; + throw Verbs::Error("timeout"); + } else if( rc < 0) { + // Error + throw Verbs::Error("error"); + } + + // Get the completion event + if( ibv_get_cq_event(_verbs.cc, &ev_cq, (void **)&ev_cq_ctx) ) { + return NULL; + } + + // Ack the event + ibv_ack_cq_events(ev_cq, 1); + + // Request notification upon the next completion event + // Do NOT restrict to solicited-only completions + if( ibv_req_notify_cq(ev_cq, 0) ) { + return NULL; + } + + // Empty the CQ: poll all of the completions from the CQ (if any exist) + do { + num_wce = ibv_poll_cq(ev_cq, BF_VERBS_WCBATCH, &wc[0]); + if( num_wce < 0 ) { + return NULL; + } + + // Loop through all work completions + for(i=0; iwr; + } else { + recv_tail->next = &(_verbs.pkt_buf[wr_id].wr); + recv_tail = recv_tail->next; + } + } // for each work completion + } while(num_wce); + + // Ensure list is NULL terminated (if we have a list) + if(recv_tail) { + recv_tail->next = NULL; + } + + return recv_head; + } + inline void check_error(int retval, std::string what) { + if( retval < 0 ) { + destroy_flows(); + destroy_queues(); + destroy_buffers(); + destroy_context(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + throw Verbs::Error(ss.str()); + } + } + inline void check_null(void* ptr, std::string what) { + if( ptr == NULL ) { + destroy_flows(); + destroy_queues(); + destroy_buffers(); + destroy_context(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + throw Verbs::Error(ss.str()); + } + } + inline void check_null_qp(void* ptr, std::string what) { + if( ptr == NULL ) { + destroy_flows(); + destroy_queues(); + destroy_buffers(); + destroy_context(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + if( errno == EPERM ) { + ss << " Do you need to set 'options ibverbs disable_raw_qp_enforcement=1' " + << "or add the CAP_NET_RAW capability?"; + } + throw Verbs::Error(ss.str()); + } + } +public: + class Error : public std::runtime_error { + typedef std::runtime_error super_t; + protected: + virtual const char* what() const throw() { + return super_t::what(); + } + public: + Error(const std::string& what_arg) + : super_t(what_arg) {} + }; + + Verbs(int fd, size_t pkt_size_max) + : _fd(fd), _pkt_size_max(pkt_size_max), _timeout(1) { + _timeout = get_timeout_ms(); + + ::memset(&_verbs, 0, sizeof(_verbs)); + check_error(ibv_fork_init(), + "make verbs fork safe"); + create_context(); + create_buffers(); + create_queues(); + link_work_requests(); + create_flows(); + } + ~Verbs() { + destroy_flows(); + destroy_queues(); + destroy_buffers(); + destroy_context(); + } + inline int recv_packet(uint8_t** pkt_ptr, int flags=0) { + // If we don't have a work-request queue on the go, + // get some new packets. + if( _verbs.pkt != NULL) { + _verbs.pkt = (bf_ibv_recv_pkt *) _verbs.pkt->wr.next; + if( _verbs.pkt == NULL ) { + this->release(_verbs.pkt_batch); + _verbs.pkt_batch = NULL; + } + } + + while( _verbs.pkt_batch == NULL ) { + try { + _verbs.pkt_batch = this->receive(); + } catch(Verbs::Error const&) { + _verbs.pkt = NULL; + errno = EAGAIN; + return -1; + } + _verbs.pkt = _verbs.pkt_batch; + } + + // IBV returns Eth/UDP/IP headers. Strip them off here + *pkt_ptr = (uint8_t *) _verbs.pkt->wr.sg_list->addr + BF_VERBS_PAYLOAD_OFFSET; + return _verbs.pkt->length - BF_VERBS_PAYLOAD_OFFSET; + } +}; diff --git a/src/ib_verbs_send.hpp b/src/ib_verbs_send.hpp new file mode 100644 index 000000000..40d2e7093 --- /dev/null +++ b/src/ib_verbs_send.hpp @@ -0,0 +1,839 @@ +/* + * Copyright (c) 2020-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// Catch for older InfiniBand verbs installs that do not have the +//#define BF_ENABLE_VERBS_OFFLOAD 0 + +#ifndef BF_VERBS_SEND_NQP +#define BF_VERBS_SEND_NQP 1 +#endif + +#ifndef BF_VERBS_SEND_NPKTBUF +#define BF_VERBS_SEND_NPKTBUF 512 +#endif + +#ifndef BF_VERBS_SEND_WCBATCH +#define BF_VERBS_SEND_WCBATCH 16 +#endif + +#ifndef BF_VERBS_SEND_NPKTBURST +#define BF_VERBS_SEND_NPKTBURST 16 +#endif + +#ifndef BF_VERBS_SEND_PACING +#define BF_VERBS_SEND_PACING 0 +#endif + +#define BF_VERBS_SEND_PAYLOAD_OFFSET 42 + +struct bf_ibv_send_pkt{ + ibv_send_wr wr; + ibv_sge sg; +}; + +struct bf_ibv_send { + ibv_context* ctx; + uint8_t port_num; + ibv_pd* pd; + ibv_comp_channel* cc; + ibv_cq** cq; + ibv_qp** qp; + + uint8_t* mr_buf; + size_t mr_size; + ibv_mr* mr; + + bf_ibv_send_pkt* pkt_buf; + bf_ibv_send_pkt* pkt_head; + + int nqueued; + + uint8_t offload_csum; + uint32_t hardware_pacing[2]; +}; + +struct __attribute__((packed)) bf_ethernet_hdr { + uint8_t dst_mac[6]; + uint8_t src_mac[6]; + uint16_t type; +}; + +struct __attribute__((packed)) bf_ipv4_hdr { + uint8_t version_ihl; + uint8_t tos; + uint16_t length; + uint16_t id; + uint16_t flags_frag; + uint8_t ttl; + uint8_t proto; + uint16_t checksum; + uint32_t src_addr; + uint32_t dst_addr; +}; + +inline void bf_ipv4_update_checksum(bf_ipv4_hdr* hdr) { + hdr->checksum = 0; + uint16_t *block = reinterpret_cast(hdr); + + uint32_t checksum = 0; + for(uint32_t i=0; i 0xFFFF ) { + checksum = (checksum & 0xFFFF) + (checksum >> 16); + } + hdr->checksum = ~htons((uint16_t) checksum); +} + +struct __attribute__((packed)) bf_udp_hdr { + uint16_t src_port; + uint16_t dst_port; + uint16_t length; + uint16_t checksum; +}; + +struct __attribute__((packed)) bf_comb_udp_hdr { + bf_ethernet_hdr ethernet; + bf_ipv4_hdr ipv4; + bf_udp_hdr udp; +}; + + +class VerbsSend { + int _fd; + size_t _pkt_size_max; + int _timeout; + uint32_t _rate_limit; + bf_ibv_send _verbs; + + void get_interface_name(char* name) { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + + ifaddrs *ifaddr; + check_error(::getifaddrs(&ifaddr), + "query interfaces"); + for(ifaddrs *ifa=ifaddr; ifa != NULL; ifa=ifa->ifa_next) { + if( ifa->ifa_addr != NULL) { + if( reinterpret_cast(ifa->ifa_addr)->sin_addr.s_addr == sin.sin_addr.s_addr ) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-truncation" + ::strncpy(name, ifa->ifa_name, IFNAMSIZ); + #pragma GCC diagnostic pop + break; + } + } + } + ::freeifaddrs(ifaddr); + } + void get_mac_address(uint8_t* mac) { + ifreq ethreq; + this->get_interface_name(&(ethreq.ifr_name[0])); + check_error(::ioctl(_fd, SIOCGIFHWADDR, ðreq), + "query interface hardware address"); + + ::memcpy(mac, (uint8_t*) ethreq.ifr_hwaddr.sa_data, 6); + } + void get_remote_mac_address(uint8_t* mac) { + uint32_t ip; + char ip_str[INET_ADDRSTRLEN]; + this->get_remote_ip_address(&(ip_str[0])); + ::inet_pton(AF_INET, &(ip_str[0]), &ip); + + if( ((ip & 0xFF) >= 224) && ((ip & 0xFF) < 240) ) { + ETHER_MAP_IP_MULTICAST(&ip, mac); + } else { + int ret = -1; + char cmd[256] = {'\0'}; + char line[256] = {'\0'}; + char ip_entry[INET_ADDRSTRLEN]; + unsigned int hw_type, flags; + char mac_str[17]; + char mask[24]; + char dev[IFNAMSIZ]; + char* end; + + sprintf(cmd, "ping -c 1 %s", ip_str); + FILE* fp = popen(cmd, "r"); + + fp = fopen("/proc/net/arp", "r"); + while( ::fgets(line, sizeof(line), fp) != NULL) { + ::sscanf(line, "%s 0x%x 0x%x %s %s %s\n", + ip_entry, &hw_type, &flags, mac_str, mask, dev); + + if( (::strcmp(ip_str, ip_entry) == 0) && (flags & ATF_COM) ) { + ret = 0; + mac[0] = (uint8_t) strtol(&mac_str[0], &end, 16); + mac[1] = (uint8_t) strtol(&mac_str[3], &end, 16); + mac[2] = (uint8_t) strtol(&mac_str[6], &end, 16); + mac[3] = (uint8_t) strtol(&mac_str[9], &end, 16); + mac[4] = (uint8_t) strtol(&mac_str[12], &end, 16); + mac[5] = (uint8_t) strtol(&mac_str[15], &end, 16); + break; + } + } + fclose(fp); + check_error(ret, "determine remote hardware address"); + } + } + void get_ip_address(char* ip) { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + inet_ntop(AF_INET, &(sin.sin_addr), ip, INET_ADDRSTRLEN); + } + void get_remote_ip_address(char* ip) { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getpeername(_fd, (sockaddr *)&sin, &len), + "query peer name"); + inet_ntop(AF_INET, &(sin.sin_addr), ip, INET_ADDRSTRLEN); + } + uint16_t get_port() { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + return ntohs(sin.sin_port); + } + uint16_t get_remote_port() { + sockaddr_in sin; + socklen_t len = sizeof(sin); + check_error(::getpeername(_fd, (sockaddr *)&sin, &len), + "query peer name"); + return ntohs(sin.sin_port); + } + uint8_t get_ttl() { + uint8_t ttl; + socklen_t len = sizeof(ttl); + check_error(::getsockopt(_fd, IPPROTO_IP, IP_TTL, &ttl, &len), + "determine TTL"); + return ttl; + } + int get_timeout_ms() { + timeval value; + socklen_t size = sizeof(value); + check_error(::getsockopt(_fd, SOL_SOCKET, SO_RCVTIMEO, &value, &size), + "query socket timeout"); + return int(value.tv_sec*1000) + int(value.tv_usec/1000); + } + uint64_t get_interface_gid() { + uint64_t id; + uint8_t mac[6] = {0}; + uint8_t buf[8] = {0}; + this->get_mac_address(&(mac[0])); + + ::memcpy(buf, (unsigned char*) &(mac[0]), 3); + buf[0] ^= 2; // Toggle G/L bit per modified EUI-64 spec + buf[3] = 0xff; + buf[4] = 0xfe; + ::memcpy(buf+5, (unsigned char*) &(mac[3]), 3); + ::memcpy(&id, buf, 8); + return id; + } + void create_context() { + int d, p, g; + int ndev, found; + ibv_device** ibv_dev_list = NULL; + ibv_context* ibv_ctx = NULL; + ibv_device_attr_ex ibv_dev_attr; + ibv_port_attr ibv_port_attr; + union ibv_gid ibv_gid; + + // Get the interface MAC address and GID + found = 0; + uint8_t mac[6] = {0}; + this->get_mac_address(&(mac[0])); + uint64_t gid = this->get_interface_gid(); + + // Find the right device + /* Query all devices */ + ibv_dev_list = ibv_get_device_list(&ndev); + check_null(ibv_dev_list, + "ibv_get_device_list"); + + /* Interogate */ + for(d=0; dfd, F_GETFL); + check_error(::fcntl(_verbs.cc->fd, F_SETFL, flags | O_NONBLOCK), + "set send completion channel to non-blocking"); + flags = ::fcntl(_verbs.cc->fd, F_GETFD); + check_error(::fcntl(_verbs.cc->fd, F_SETFD, flags | O_CLOEXEC), + "set send completion channel to non-blocking"); + ::madvise(_verbs.cc, sizeof(ibv_pd), MADV_DONTFORK); + + // Setup the completion queues + _verbs.cq = (ibv_cq**) ::malloc(BF_VERBS_SEND_NQP * sizeof(ibv_cq*)); + check_null(_verbs.cq, + "allocate send completion queues"); + ::memset(_verbs.cq, 0, BF_VERBS_SEND_NQP * sizeof(ibv_cq*)); + for(i=0; ilkey; + } + } + + // Link the work requests to send queue + uint32_t send_flags = IBV_SEND_SIGNALED; + #if defined BF_ENABLE_VERBS_OFFLOAD && BF_ENABLE_VERBS_OFFLOAD + if( _verbs.offload_csum ) { + send_flags |= IBV_SEND_IP_CSUM; + } + #endif + + for(i=0; istate) { + case IBV_QPS_RESET: // Unexpected, but maybe user reset it + qp_attr.qp_state = IBV_QPS_INIT; + qp_attr.port_num = _verbs.port_num; + if( ibv_modify_qp(_verbs.qp[i], &qp_attr, IBV_QP_STATE|IBV_QP_PORT) ) { + return NULL; + } + case IBV_QPS_INIT: + qp_attr.qp_state = IBV_QPS_RTR; + qp_attr.port_num = _verbs.port_num; + if( ibv_modify_qp(_verbs.qp[i], &qp_attr, IBV_QP_STATE) ) { + return NULL; + } + case IBV_QPS_RTR: + qp_attr.qp_state = IBV_QPS_RTS; + if(ibv_modify_qp(_verbs.qp[i], &qp_attr, IBV_QP_STATE)) { + return NULL; + } + break; + case IBV_QPS_RTS: + break; + default: + return NULL; + } + } + + // Get the completion event(s) + while( ibv_get_cq_event(_verbs.cc, &ev_cq, (void **)&ev_cq_ctx) == 0 ) { + // Ack the event + ibv_ack_cq_events(ev_cq, 1); + } + + for(i=0; i 0 ) { + for(i=0; iwr.next = &(_verbs.pkt_head->wr); + _verbs.pkt_head = send_pkt; + } // for each work completion + + // Decrement the number of packet buffers in use + _verbs.nqueued -= num_wce; + } while(num_wce); + } + } + + if( npackets == 0 || !_verbs.pkt_head ) { + return NULL; + } + + send_head = _verbs.pkt_head; + send_tail = _verbs.pkt_head; + for(i=0; iwr.next; i++) { + send_tail = (bf_ibv_send_pkt*) send_tail->wr.next; + } + + _verbs.pkt_head = (bf_ibv_send_pkt*) send_tail->wr.next; + send_tail->wr.next = NULL; + + _verbs.nqueued += npackets; + + return send_head; + } + inline void check_error(int retval, std::string what) { + if( retval < 0 ) { + destroy_queues(); + destroy_buffers(); + destroy_context(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + throw VerbsSend::Error(ss.str()); + } + } + inline void check_null(void* ptr, std::string what) { + if( ptr == NULL ) { + destroy_queues(); + destroy_buffers(); + destroy_context(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + throw VerbsSend::Error(ss.str()); + } + } + inline void check_null_qp(void* ptr, std::string what) { + if( ptr == NULL ) { + destroy_queues(); + destroy_buffers(); + destroy_context(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + if( errno == EPERM ) { + ss << " Do you need to set 'options ibverbs disable_raw_qp_enforcement=1' " + << "or add the CAP_NET_RAW capability?"; + } + throw VerbsSend::Error(ss.str()); + } + } +public: + class Error : public std::runtime_error { + typedef std::runtime_error super_t; + protected: + virtual const char* what() const throw() { + return super_t::what(); + } + public: + Error(const std::string& what_arg) + : super_t(what_arg) {} + }; + + VerbsSend(int fd, size_t pkt_size_max) + : _fd(fd), _pkt_size_max(pkt_size_max), _timeout(1), _rate_limit(0) { + _timeout = get_timeout_ms(); + + ::memset(&_verbs, 0, sizeof(_verbs)); + check_error(ibv_fork_init(), + "make verbs fork safe"); + create_context(); + create_buffers(); + create_queues(); + link_work_requests(); + } + ~VerbsSend() { + destroy_queues(); + destroy_buffers(); + destroy_context(); + } + inline void set_rate_limit(uint32_t rate_limit, size_t udp_length, size_t max_burst_size=BF_VERBS_SEND_NPKTBURST) { + int i; + + // Converts to B/s to kb/s assuming a packet size + size_t pkt_size = udp_length + BF_VERBS_SEND_PAYLOAD_OFFSET; + rate_limit = ((float) rate_limit) / udp_length * pkt_size * 8 / 1000; + + // Verify that this rate limit is valid + if( rate_limit == 0 ) { + rate_limit = _verbs.hardware_pacing[1]; + } + if( rate_limit < _verbs.hardware_pacing[0] || rate_limit > _verbs.hardware_pacing[1] ) { + throw VerbsSend::Error("Failed to set rate limit, specified rate limit is out of range"); + } + + // Apply the rate limit + #if defined BF_VERBS_SEND_PACING && BF_VERBS_SEND_PACING + ibv_qp_rate_limit_attr rl_attr; + ::memset(&rl_attr, 0, sizeof(ibv_qp_rate_limit_attr)); + rl_attr.rate_limit = rate_limit; + rl_attr.typical_pkt_sz = pkt_size; + rl_attr.max_burst_sz = max_burst_size*pkt_size; + for(i=0; iget_mac_address(&(src_mac[0])); + this->get_remote_mac_address(&(dst_mac[0])); + + ::memset(hdr, 0, sizeof(bf_ethernet_hdr)); + ::memcpy(hdr->dst_mac, dst_mac, 6); + ::memcpy(hdr->src_mac, src_mac, 6); + hdr->type = htons(0x0800); // IPv4 + } + inline void get_ipv4_header(bf_ipv4_hdr* hdr, size_t udp_length=0) { + uint8_t ttl = this->get_ttl(); + uint32_t src_ip, dst_ip; + char src_ip_str[INET_ADDRSTRLEN], dst_ip_str[INET_ADDRSTRLEN]; + this->get_ip_address(&(src_ip_str[0])); + inet_pton(AF_INET, &(src_ip_str[0]), &src_ip); + this->get_remote_ip_address(&(dst_ip_str[0])); + inet_pton(AF_INET, &(dst_ip_str[0]), &dst_ip); + + ::memset(hdr, 0, sizeof(bf_ipv4_hdr)); + hdr->version_ihl = htons(0x4500); // v4 + 20-byte header + hdr->length = htons((uint16_t) (20 + 8 + udp_length)); + hdr->flags_frag = htons(1<<14); // don't fragment + hdr->ttl = ttl; + hdr->proto = 0x11; // UDP + hdr->src_addr = src_ip; + hdr->dst_addr = dst_ip; + if( !_verbs.offload_csum ) { + bf_ipv4_update_checksum(hdr); + } + } + inline void get_udp_header(bf_udp_hdr* hdr, size_t udp_length=0) { + uint16_t src_port, dst_port; + src_port = this->get_port(); + dst_port = this->get_remote_port(); + + ::memset(hdr, 0, sizeof(bf_udp_hdr)); + hdr->src_port = htons(src_port); + hdr->dst_port = htons(dst_port); + hdr->length = htons((uint16_t) (8 + udp_length)); + } + inline int sendmmsg(mmsghdr *mmsg, int npackets, int flags=0) { + int ret; + bf_ibv_send_pkt* head; + ibv_send_wr *s; + + if( npackets > BF_VERBS_SEND_NPKTBUF ) { + throw VerbsSend::Error(std::string("Too many packets for the current buffer size")); + } + + // Reclaim a set of buffers to use + head = this->get_packet_buffers(npackets); + + // Load in the new data + int i; + uint64_t offset; + for(i=0; iwr), &s); + if( ret ) { + ret = -1; + } else { + ret = npackets; + } + return ret; + } +}; diff --git a/src/linalg.cu b/src/linalg.cu index 5f2fc0078..4bbe40fb7 100644 --- a/src/linalg.cu +++ b/src/linalg.cu @@ -127,7 +127,6 @@ BFstatus bfMatMul_aa_exec_nobatch(BFlinalg handle, (double*)c_data, c_stride)); break; } -#if CUDART_VERSION >= 8000 case BF_DTYPE_CI8: { BF_ASSERT(c_type == BF_DTYPE_CF32, BF_STATUS_UNSUPPORTED_DTYPE); float alpha_f = (float)alpha; @@ -147,12 +146,10 @@ BFstatus bfMatMul_aa_exec_nobatch(BFlinalg handle, } BF_FAIL("Supported dtype for array a", BF_STATUS_UNSUPPORTED_DTYPE); } -#endif case BF_DTYPE_CF32: { BF_ASSERT(c_type == BF_DTYPE_CF32, BF_STATUS_UNSUPPORTED_DTYPE); float alpha_f = (float)alpha; float beta_f = (float)beta; -#if CUDART_VERSION >= 8000 if( get_cuda_device_cc() >= 50 ) { BF_CHECK_CUBLAS(cublasCherk3mEx(handle->cublas(), uplo, trans, n, k, @@ -166,7 +163,6 @@ BFstatus bfMatMul_aa_exec_nobatch(BFlinalg handle, c_stride)); break; } -#endif BF_CHECK_CUBLAS(cublasCherk(handle->cublas(), uplo, trans, n, k, &alpha_f, @@ -213,7 +209,7 @@ BFstatus bfMatMul_aa_exec(BFlinalg handle, //bool use_bf_cherk = use_bf_cherk_str && atoi(use_bf_cherk_str); enum { BF_CUBLAS_CHERK_THRESHOLD = 896 }; if( //use_bf_cherk && - (CUDART_VERSION < 8000 || n < BF_CUBLAS_CHERK_THRESHOLD) && + n < BF_CUBLAS_CHERK_THRESHOLD && trans == CUBLAS_OP_N && n % 2 == 0 && a_stride % 2 == 0 && a_batchstride % 2 == 0 && @@ -413,7 +409,6 @@ BFstatus bfMatMul_ab_exec_nobatch(BFlinalg handle, (double*)c_data, c_stride)); break; } -#if CUDART_VERSION >= 8000 case BF_DTYPE_CI8: { BF_ASSERT(c_type == BF_DTYPE_CF32, BF_STATUS_UNSUPPORTED_DTYPE); cuComplex alpha_cf = make_cuComplex(alpha, 0); @@ -436,12 +431,10 @@ BFstatus bfMatMul_ab_exec_nobatch(BFlinalg handle, } BF_FAIL("Supported dtype for input array", BF_STATUS_UNSUPPORTED_DTYPE); } -#endif case BF_DTYPE_CF32: { BF_ASSERT(c_type == BF_DTYPE_CF32, BF_STATUS_UNSUPPORTED_DTYPE); cuComplex alpha_cf = make_cuComplex(alpha, 0); cuComplex beta_cf = make_cuComplex(beta, 0); -#if CUDART_VERSION >= 8000 if( get_cuda_device_cc() >= 50 ) { BF_CHECK_CUBLAS(cublasCgemm3m(handle->cublas(), trans_a, trans_b, m, n, k, @@ -455,7 +448,6 @@ BFstatus bfMatMul_ab_exec_nobatch(BFlinalg handle, c_stride)); break; } -#endif BF_CHECK_CUBLAS(cublasCgemm(handle->cublas(), trans_a, trans_b, m, n, k, &alpha_cf, @@ -484,6 +476,166 @@ BFstatus bfMatMul_ab_exec_nobatch(BFlinalg handle, return BF_STATUS_SUCCESS; } +BFstatus bfMatMul_ab_exec_batch(BFlinalg handle, + cudaStream_t stream, + cublasOperation_t trans_a, + cublasOperation_t trans_b, + long m, + long n, + long k, + double alpha, + void const* a_data, + BFdtype a_type, + long a_stride, + long a_batchstride, + void const* b_data, + BFdtype b_type, + long b_stride, + long b_batchstride, + double beta, + void* c_data, + BFdtype c_type, + long c_stride, + long c_batchstride, + long nbatch) { + BF_TRACE_STREAM(stream); + BF_CHECK_CUBLAS(cublasSetStream(handle->cublas(), stream)); + BF_CHECK_CUBLAS(cublasSetPointerMode(handle->cublas(), + CUBLAS_POINTER_MODE_HOST)); + BF_ASSERT(a_data, BF_STATUS_INVALID_POINTER); + BF_ASSERT(b_data, BF_STATUS_INVALID_POINTER); + BF_ASSERT(c_data, BF_STATUS_INVALID_POINTER); + BF_ASSERT(a_type == b_type, BF_STATUS_UNSUPPORTED_DTYPE); + // TODO: Look into optimizations using cublasGemmEx algo selection and + // batched/strided APIs. + switch( a_type ) { + case BF_DTYPE_F32: { + BF_ASSERT(c_type == BF_DTYPE_F32, BF_STATUS_UNSUPPORTED_DTYPE); + BF_CHECK_CUBLAS(cublasSgemmStridedBatched(handle->cublas(), + trans_a, + trans_b, + m, + n, + k, + (float *)&alpha, + (const float *)a_data, + a_stride, + a_batchstride, + (const float *)b_data, + b_stride, + b_batchstride, + (float *)&beta, + (float *)c_data, + c_stride, + c_batchstride, + nbatch)); + break; + } + case BF_DTYPE_F64: { + BF_ASSERT(c_type == BF_DTYPE_F64, BF_STATUS_UNSUPPORTED_DTYPE); + BF_CHECK_CUBLAS(cublasDgemmStridedBatched(handle->cublas(), + trans_a, + trans_b, + m, + n, + k, + &alpha, + (const double *)a_data, + a_stride, + a_batchstride, + (const double *)b_data, + b_stride, + b_batchstride, + &beta, + (double *)c_data, + c_stride, + c_batchstride, + nbatch)); + break; + } + case BF_DTYPE_CI8: { + BF_ASSERT(c_type == BF_DTYPE_CF32, BF_STATUS_UNSUPPORTED_DTYPE); + cuComplex alpha_cf = make_cuComplex(alpha, 0); + cuComplex beta_cf = make_cuComplex(beta, 0); + BF_CHECK_CUBLAS(cublasGemmStridedBatchedEx(handle->cublas(), + trans_a, + trans_b, + m, + n, + k, + &alpha_cf, + a_data, + CUDA_C_8I, + a_stride, + a_batchstride, + b_data, + CUDA_C_8I, + b_stride, + b_batchstride, + &beta_cf, + c_data, + CUDA_C_32F, + c_stride, + c_batchstride, + nbatch, + CUBLAS_COMPUTE_32F, CUBLAS_GEMM_DEFAULT)); + } + case BF_DTYPE_CF32: { + BF_ASSERT(c_type == BF_DTYPE_CF32, BF_STATUS_UNSUPPORTED_DTYPE); + const cuComplex alpha_cf = make_cuComplex(alpha, 0); + const cuComplex beta_cf = make_cuComplex(beta, 0); + BF_CHECK_CUBLAS(cublasCgemm3mStridedBatched(handle->cublas(), + trans_a, + trans_b, + m, + n, + k, + &alpha_cf, + (const cuComplex *)a_data, + a_stride, + a_batchstride, + (const cuComplex *)b_data, + b_stride, + b_batchstride, + &beta_cf, + (cuComplex *)c_data, + c_stride, + c_batchstride, + nbatch + )); + break; + } + case BF_DTYPE_CF64: { + BF_ASSERT(c_type == BF_DTYPE_CF64, BF_STATUS_UNSUPPORTED_DTYPE); + const cuDoubleComplex alpha_cf = make_cuDoubleComplex(alpha, 0); + const cuDoubleComplex beta_cf = make_cuDoubleComplex(beta, 0); + BF_CHECK_CUBLAS(cublasZgemmStridedBatched(handle->cublas(), + trans_a, + trans_b, + m, + n, + k, + &alpha_cf, + (const cuDoubleComplex *)a_data, + a_stride, + a_batchstride, + (const cuDoubleComplex *)b_data, + b_stride, + b_batchstride, + &beta_cf, + (cuDoubleComplex *)c_data, + c_stride, + c_batchstride, + nbatch + )); + break; + } + default: + BF_FAIL("Supported dtype for input array", BF_STATUS_UNSUPPORTED_DTYPE); + } + return BF_STATUS_SUCCESS; +} + BFstatus bfMatMul_ab_exec(BFlinalg handle, cudaStream_t stream, cublasOperation_t trans_a, @@ -506,13 +658,12 @@ BFstatus bfMatMul_ab_exec(BFlinalg handle, BFdtype c_type, long c_stride, long c_batchstride) { - // TODO: Use batched algos here where possible + // We prefer the CI4@CF32 -> CF32 code + // second choice would be the batched algorithms - //char* use_bf_cgemm_str = getenv("BF_CGEMM"); - //bool use_bf_cgemm = use_bf_cgemm_str && atoi(use_bf_cgemm_str); - if( //use_bf_cgemm && - n <= 12 && - trans_a == CUBLAS_OP_T && trans_b == CUBLAS_OP_N && + + if( trans_a == CUBLAS_OP_T && + trans_b == CUBLAS_OP_N && (a_type == BF_DTYPE_CI4 || a_type == BF_DTYPE_CI8) && (b_type == BF_DTYPE_CI16 || b_type == BF_DTYPE_CF16 || b_type == BF_DTYPE_CF32) && c_type == BF_DTYPE_CF32 ) { @@ -526,19 +677,45 @@ BFstatus bfMatMul_ab_exec(BFlinalg handle, stream)); } - for( long b=0; b 12 && a_type != BF_DTYPE_CI8 ) { + BF_CHECK( bfMatMul_ab_exec_batch(handle, + stream, + trans_a, + trans_b, + m, + n, + k, + alpha, + a_data, + a_type, + a_stride, + a_batchstride, + b_data, + b_type, + b_stride, + b_batchstride, + beta, + c_data, + c_type, + c_stride, + c_batchstride, + nbatch) ); + } else { + for( long b=0; b inline __device__ T shfl_warp_sync(T var, int srcLane, int width=warpSize) { -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 - return __shfl_sync(0xFFFFFFFF, var, srcLane, width); -#else - return __shfl(var, srcLane, width); -#endif +return __shfl_sync(0xFFFFFFFF, var, srcLane, width); } inline __host__ __device__ @@ -537,7 +533,9 @@ void bf_cherk_N(int N, int K, int nbatch, int A_offset = A_byte_offset / element_bytes; size_t A_nelement_total = - std::max(A_stride * K, A_batchstride * nbatch) + A_offset; + (A_offset + N) // the elements in the first row of first batch + + (K - 1) * A_stride // the elements in the rest of the first batch + + (nbatch - 1) * A_batchstride; // the elements for the remaining batches size_t texture_element_limit = 1 << 27; BF_ASSERT_EXCEPTION(A_nelement_total <= texture_element_limit, BF_STATUS_UNSUPPORTED_SHAPE); @@ -653,11 +651,7 @@ inline __device__ T warp_all_sum(T x) { typedef typename shflable_type::type shfl_type; #pragma unroll for( int k=WIDTH>>1; k>=1; k>>=1 ) { -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 x += type_pun(__shfl_xor_sync(0xFFFFFFFF, type_pun(x), k, WIDTH)); -#else - x += type_pun(__shfl_xor(type_pun(x), k, WIDTH)); -#endif } return x; } @@ -836,7 +830,7 @@ void bf_cgemm_TN_smallM_staticN_v2(int M, int K_blocks = (K - 1) / BLOCK_X + 1; int s_B_stride = K_blocks * BLOCK_X; size_t smem = N * s_B_stride * BF_DTYPE_NBYTE(B_type)*2; - bool B_fits_in_shared_mem = (smem <= 48*1024); + bool B_fits_in_shared_mem = (smem <= BF_GPU_SHAREDMEM); BF_ASSERT_EXCEPTION(B_fits_in_shared_mem, BF_STATUS_UNSUPPORTED); /* // TODO: Use cudaLaunchKernel instead of <<< >>> @@ -867,13 +861,11 @@ void bf_cgemm_TN_smallM_staticN_v2(int M, JonesVec, JonesVec, Complex); break; } -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 //case BF_DTYPE_CF16: { // LAUNCH_BF_CGEMM_TN_SMALLM_KERNEL( // JonesVec, JonesVec, Complex); // break; //} -#endif case BF_DTYPE_CF32: { LAUNCH_BF_CGEMM_TN_SMALLM_KERNEL( JonesVec, JonesVec, Complex); @@ -892,13 +884,11 @@ void bf_cgemm_TN_smallM_staticN_v2(int M, JonesVec, JonesVec, Complex); break; } -#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 9 //case BF_DTYPE_CF16: { // LAUNCH_BF_CGEMM_TN_SMALLM_KERNEL( // JonesVec, JonesVec, Complex); // break; //} -#endif case BF_DTYPE_CF32: { LAUNCH_BF_CGEMM_TN_SMALLM_KERNEL( JonesVec, JonesVec, Complex); diff --git a/src/linalg_kernels.h b/src/linalg_kernels.h index 71f4fc0e9..ffd4698d5 100644 --- a/src/linalg_kernels.h +++ b/src/linalg_kernels.h @@ -32,6 +32,7 @@ #include +#include #include inline const char* _cublasGetErrorString(cublasStatus_t status) { diff --git a/src/map.cpp b/src/map.cpp index a8b627b3e..ca6a30cd6 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,11 +38,9 @@ bfMap(3, c.shape, {"dm", "t"}, // This enables print-out of generated source and PTX //#define BF_DEBUG_RTC 1 -#ifndef BF_MAP_KERNEL_CACHE_SIZE -#define BF_MAP_KERNEL_CACHE_SIZE 128 -#endif - +#include #include +#include "fileutils.hpp" #include "cuda.hpp" #include "utils.hpp" @@ -68,12 +66,20 @@ bfMap(3, c.shape, {"dm", "t"}, #include #include #include +#include #include using std::cout; using std::cerr; using std::endl; +#include +#include +#include + +#include +#include + #define BF_CHECK_NVRTC(call) \ do { \ nvrtcResult ret = call; \ @@ -329,11 +335,21 @@ BFstatus build_map_kernel(int* external_ndim, program_name, nheader, header_codes, header_names) ); std::vector options; - options.push_back("--std=c++11"); + std::stringstream cs_ss; +#if defined(BF_MAP_KERNEL_STDCXX) + cs_ss << BF_MAP_KERNEL_STDCXX; +#else + cs_ss << "c++11"; +#endif + options.push_back("--std="+cs_ss.str()); options.push_back("--device-as-default-execution-space"); options.push_back("--use_fast_math"); std::stringstream cc_ss; +#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE + cc_ss << "compute_" << BF_GPU_MIN_ARCH; +#else cc_ss << "compute_" << get_cuda_device_cc(); +#endif options.push_back("-arch="+cc_ss.str()); options.push_back("--restrict"); std::vector options_c; @@ -343,7 +359,7 @@ BFstatus build_map_kernel(int* external_ndim, nvrtcResult ret = nvrtcCompileProgram(program, options_c.size(), &options_c[0]); -#if BF_DEBUG +#if BF_DEBUG_ENABLED size_t logsize; // Note: Includes the trailing NULL BF_CHECK_NVRTC( nvrtcGetProgramLogSize(program, &logsize) ); @@ -353,7 +369,7 @@ BFstatus build_map_kernel(int* external_ndim, BF_CHECK_NVRTC( nvrtcGetProgramLog(program, &log[0]) ); int i = 1; for( std::string line; std::getline(code, line); ++i ) { - cout << std::setfill(' ') << std::setw(3) << i << " " << line << endl; + std::cout << std::setfill(' ') << std::setw(3) << i << " " << line << endl; } std::cout << "---------------------------------------------------" << std::endl; std::cout << "--- JIT compile log for program " << program_name << " ---" << std::endl; @@ -373,7 +389,7 @@ BFstatus build_map_kernel(int* external_ndim, char* ptx = &vptx[0]; BF_CHECK_NVRTC( nvrtcGetPTX(program, &ptx[0]) ); BF_CHECK_NVRTC( nvrtcDestroyProgram(&program) ); -#if BF_DEBUG +#if BF_DEBUG_ENABLED if( EnvVars::get("BF_PRINT_MAP_KERNELS_PTX", "0") != "0" ) { std::cout << ptx << std::endl; } @@ -389,6 +405,228 @@ BFstatus build_map_kernel(int* external_ndim, return BF_STATUS_SUCCESS; } +#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE +class DiskCacheMgr { + std::string _cachedir; + std::string _indexfile; + std::string _cachefile; + std::set _created_dirs; + mutable std::mutex _mutex; + bool _loaded; + std::hash _get_name; + + void tag_cache(void) { + // NOTE: Must be called from within a LockFile lock + int rt, drv; + cudaRuntimeGetVersion(&rt); + cudaDriverGetVersion(&drv); + + std::ofstream info; + + if( !file_exists(_cachedir + BF_MAP_KERNEL_DISK_CACHE_VERSION_FILE) ) { + try { + info.open(_cachedir + BF_MAP_KERNEL_DISK_CACHE_VERSION_FILE, std::ios::out); + info << BF_MAP_KERNEL_DISK_CACHE_VERSION << " " << rt << " " << drv << endl; + info.close(); + } catch( std::exception const& ) {} + } + } + + void validate_cache(void) { + // NOTE: Must be called from within a LockFile lock + bool status = true; + int rt, drv, cached_mc, cached_rt, cached_drv; + cudaRuntimeGetVersion(&rt); + cudaDriverGetVersion(&drv); + + std::ifstream info; + try { + // Open + info.open(_cachedir + BF_MAP_KERNEL_DISK_CACHE_VERSION_FILE, std::ios::in); + + // Read + info >> cached_mc >> cached_rt >> cached_drv; + + // Close + info.close(); + } catch( std::exception const& ) { + cached_mc = cached_rt = cached_drv = -1; + } + + if( BF_MAP_KERNEL_DISK_CACHE_VERSION != cached_mc || rt != cached_rt || drv != cached_drv ) { + status = false; + } + + if( !status ) { + try { + remove_files_with_suffix(_cachedir, ".inf"); + remove_files_with_suffix(_cachedir, ".ptx"); + remove_file(_cachedir + BF_MAP_KERNEL_DISK_CACHE_VERSION_FILE); + } catch( std::exception const& ) {} + } + } + + // TODO: Per arch. caches/files? Compile to cubin and cache per arch.? + void write_to_disk(std::string cache_key, + std::string kernel_name, + std::string ptx, + bool basic_indexing_only) { + // Do this with a file lock to avoid interference from other processes + LockFile lock(_cachedir + ".lock"); + + this->tag_cache(); + + // Get the name to save the kernel to + std::stringstream basename; + basename << std::hex << std::uppercase << _get_name(cache_key); + _indexfile = _cachedir + basename.str() + ".inf"; + _cachefile = _cachedir + basename.str() + ".ptx"; + + std::ofstream index, cache; + try { + // Open + index.open(_indexfile, std::ios::out); + cache.open(_cachefile, std::ios::out|std::ios::binary); + + // Write Info + // * PTX size + index << ptx.size() << endl; + // * Kernel name + index << kernel_name << endl; + // * Whether or not the kernel supports basic indexing only + index << basic_indexing_only << endl; + // * In-memory cache key + index << cache_key; + + // Write PTX + cache.write(ptx.c_str(), ptx.size()); + + // Done + index.close(); + cache.close(); + } catch( std::exception const& ) {} + } + + void load_from_disk(ObjectCache > *kernel_cache) { + // Do this with a file lock to avoid interference from other processes + LockFile lock(_cachedir + ".lock"); + + // Validate the cache + this->validate_cache(); + + std::ifstream index, cache; + size_t kernel_size; + std::string kernel_name; + bool basic_indexing_only; + std::string cache_key; + std::string ptx; + CUDAKernel kernel; + + std::string field; + + // Find the files + DIR* dir = opendir(_cachedir.c_str()); + struct dirent *entry; + while( (entry = readdir(dir)) != NULL ) { + _indexfile = _cachedir + std::string(entry->d_name); + if( _indexfile.size() < 4 ) { + continue; + } + if( _indexfile.compare(_indexfile.size()-4, 4, ".inf") == 0 ) { + // We have an info file, get the corresponding ptx file + _cachefile = _indexfile.substr(0, _indexfile.size()-4) + ".ptx"; + + try { + // Open + index.open(_indexfile, std::ios::in); + cache.open(_cachefile, std::ios::in|std::ios::binary); + + // Read in info and then build the kernels + // * PTX size + std::getline(index, field); + kernel_size = std::atoi(field.c_str()); + // * Kernel name + std::getline(index, kernel_name); + // * Whether or not the kernel supports basic indexing only + std::getline(index, field); + basic_indexing_only = false; + if( std::atoi(field.c_str()) > 0 ) { + basic_indexing_only = true; + } + // * In-memory cache name + std::getline(index, cache_key); + while( std::getline(index, field) ) { + cache_key = cache_key + "\n" + field; + } + + // Check the cache to see if it is aleady there... + if( !kernel_cache->contains(cache_key) ) { + ptx.resize(kernel_size); + cache.read(&ptx[0], kernel_size); + kernel.set(kernel_name.c_str(), ptx.c_str()); + + kernel_cache->insert(cache_key, + std::make_pair(kernel, basic_indexing_only)); + } + + // Done + index.close(); + cache.close(); + } catch( std::exception const&) {} + } + } + closedir(dir); + } + + void clear_cache() { + // Do this with a file lock to avoid interference from other processes + LockFile lock(_cachedir + ".lock"); + + try { + remove_files_with_suffix(_cachedir, ".inf"); + remove_files_with_suffix(_cachedir, ".ptx"); + } catch( std::exception const& ) {} + } + + DiskCacheMgr() + : _cachedir(get_home_dir()+"/.bifrost/"+BF_MAP_KERNEL_DISK_CACHE_SUBDIR+"/"), + _loaded(false) { + make_dir(_cachedir); + } +public: + DiskCacheMgr(DiskCacheMgr& ) = delete; + DiskCacheMgr& operator=(DiskCacheMgr& ) = delete; + + static DiskCacheMgr& get() { + static DiskCacheMgr cache; + return cache; + } + + bool load(ObjectCache > *kernel_cache) { + if( !_loaded ) { + std::lock_guard lock(_mutex); + this->load_from_disk(kernel_cache); + _loaded = true; + } + return _loaded; + } + + void save(std::string cache_key, + std::string kernel_name, + std::string ptx, + bool basic_indexing_only) { + std::lock_guard lock(_mutex); + this->write_to_disk(cache_key, kernel_name, ptx, basic_indexing_only); + } + + void clear() { + std::lock_guard lock(_mutex); + this->clear_cache(); + _loaded = false; + } +}; +#endif + BFstatus bfMap(int ndim, long const* shape, char const*const* axis_names, @@ -402,7 +640,7 @@ BFstatus bfMap(int ndim, int const block_axes[2]) { // Map containing compiled kernels and basic_indexing_only flag thread_local static ObjectCache > - kernel_cache(BF_MAP_KERNEL_CACHE_SIZE); + kernel_cache(BF_MAP_KERNEL_CACHE_SIZE); BF_ASSERT(ndim >= 0, BF_STATUS_INVALID_ARGUMENT); //BF_ASSERT(!ndim || shape, BF_STATUS_INVALID_POINTER); //BF_ASSERT(!ndim || axis_names, BF_STATUS_INVALID_POINTER); @@ -462,6 +700,10 @@ BFstatus bfMap(int ndim, } std::string cache_key = cache_key_ss.str(); +#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE + DiskCacheMgr::get().load(&kernel_cache); +#endif + if( !kernel_cache.contains(cache_key) ) { std::string ptx; std::string kernel_name; @@ -489,9 +731,9 @@ BFstatus bfMap(int ndim, BF_TRY(kernel.set(kernel_name.c_str(), ptx.c_str())); kernel_cache.insert(cache_key, std::make_pair(kernel, basic_indexing_only)); - //std::cout << "INSERTING INTO CACHE" << std::endl; - } else { - //std::cout << "FOUND IN CACHE" << std::endl; +#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE + DiskCacheMgr::get().save(cache_key, kernel_name, ptx, basic_indexing_only); +#endif } auto& cache_entry = kernel_cache.get(cache_key); CUDAKernel& kernel = cache_entry.first; @@ -553,3 +795,10 @@ BFstatus bfMap(int ndim, return BF_STATUS_SUCCESS; } + +BFstatus bfMapClearCache() { +#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE + DiskCacheMgr::get().clear(); +#endif + return BF_STATUS_SUCCESS; +} diff --git a/src/memory.cpp b/src/memory.cpp index 881b328c5..e76567cfd 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. +/* + * Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,6 +27,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include "utils.hpp" #include "cuda.hpp" @@ -62,14 +63,15 @@ BFstatus bfGetSpace(const void* ptr, BFspace* space) { #if defined(CUDA_VERSION) && CUDA_VERSION >= 10000 } else { switch( ptr_attrs.type ) { - case cudaMemoryTypeHost: *space = BF_SPACE_SYSTEM; break; - case cudaMemoryTypeDevice: *space = BF_SPACE_CUDA; break; - case cudaMemoryTypeManaged: *space = BF_SPACE_CUDA_MANAGED; break; - default: { - // This should never be reached - BF_FAIL("Valid memoryType", BF_STATUS_INTERNAL_ERROR); - } - } + case cudaMemoryTypeUnregistered: *space = BF_SPACE_SYSTEM; break; + case cudaMemoryTypeHost: *space = BF_SPACE_CUDA_HOST; break; + case cudaMemoryTypeDevice: *space = BF_SPACE_CUDA; break; + case cudaMemoryTypeManaged: *space = BF_SPACE_CUDA_MANAGED; break; + default: { + // This should never be reached + BF_FAIL("Valid memoryType", BF_STATUS_INTERNAL_ERROR); + } + } } #else } else if( ptr_attrs.isManaged ) { @@ -181,7 +183,8 @@ BFstatus bfMemcpy(void* dst, case BF_SPACE_CUDA_HOST: // fall-through case BF_SPACE_SYSTEM: ::memcpy(dst, src, count); return BF_STATUS_SUCCESS; case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; - // TODO: BF_SPACE_CUDA_MANAGED + // Is this the right thing to do? + case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; default: BF_FAIL("Valid bfMemcpy dst space", BF_STATUS_INVALID_ARGUMENT); } break; @@ -190,12 +193,14 @@ BFstatus bfMemcpy(void* dst, switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through case BF_SPACE_SYSTEM: kind = cudaMemcpyDeviceToHost; break; - case BF_SPACE_CUDA: kind = cudaMemcpyDeviceToDevice; break; - // TODO: BF_SPACE_CUDA_MANAGED + case BF_SPACE_CUDA: kind = cudaMemcpyDeviceToDevice; break; + case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; default: BF_FAIL("Valid bfMemcpy dst space", BF_STATUS_INVALID_ARGUMENT); } break; } + // Is this the right thing to do? + case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; default: BF_FAIL("Valid bfMemcpy src space", BF_STATUS_INVALID_ARGUMENT); } BF_TRACE_STREAM(g_cuda_stream); @@ -263,6 +268,8 @@ BFstatus bfMemcpy2D(void* dst, } break; } + // Is this the right thing to do? + case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; default: BF_FAIL("Valid bfMemcpy2D src space", BF_STATUS_INVALID_ARGUMENT); } BF_TRACE_STREAM(g_cuda_stream); diff --git a/src/packet_capture.cpp b/src/packet_capture.cpp new file mode 100644 index 000000000..ad99f1ea5 --- /dev/null +++ b/src/packet_capture.cpp @@ -0,0 +1,430 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "packet_capture.hpp" + +#define BF_JAYCE_DEBUG 0 + +#if BF_JAYCE_DEBUG +#define BF_PRINTD(stmt) \ + std::cout << stmt << std::endl +#else // not BF_JAYCE_DEBUG +#define BF_PRINTD(stmt) +#endif + +// Reads, decodes and unpacks frames into the provided buffers +// Note: Read continues until the first frame that belongs +// beyond the end of the provided buffers. This frame is +// saved, accessible via get_last_frame(), and will be +// processed on the next call to run() if possible. +template +int PacketCaptureThread::run(uint64_t seq_beg, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t* ngood_bytes[], + size_t* src_ngood_bytes[], + PDC* decode, + PPC* process) { + uint64_t seq_end = seq_beg + nbuf*nseq_per_obuf; + size_t local_ngood_bytes[2] = {0, 0}; + int ret; + while( true ) { + if( !_have_pkt ) { + uint8_t* pkt_ptr; + int pkt_size = _method->recv_packet(&pkt_ptr); + if( pkt_size <= 0 ) { + if( errno == EAGAIN || errno == EWOULDBLOCK ) { + ret = CAPTURE_TIMEOUT; // Timed out + } else if( errno == EINTR ) { + ret = CAPTURE_INTERRUPTED; // Interrupted by signal + } else if( pkt_size == 0 ) { + ret = CAPTURE_NO_DATA; + } else { + ret = CAPTURE_ERROR; // Socket error + } + break; + } + BF_PRINTD("HERE"); + if( !(*decode)(pkt_ptr, pkt_size, &_pkt) ) { + BF_PRINTD("INVALID " << std::hex << _pkt.sync << " " << std::dec << _pkt.src << " " << _pkt.src << " " << _pkt.time_tag << " " << _pkt.tuning << " " << _pkt.valid_mode); + ++_stats.ninvalid; + _stats.ninvalid_bytes += pkt_size; + continue; + } + BF_PRINTD("VALID " << std::hex << _pkt.sync << " " << std::dec << _pkt.src << " " << _pkt.src << " " << _pkt.time_tag << " " << _pkt.tuning << " " << _pkt.valid_mode); + _have_pkt = true; + } + BF_PRINTD("NOW" << " " << _pkt.seq << " >= " << seq_end); + if( greater_equal(_pkt.seq, seq_end) ) { + // Reached the end of this processing gulp, so leave this + // packet unprocessed and return. + ret = CAPTURE_SUCCESS; + BF_PRINTD("BREAK NOW"); + break; + } + BF_PRINTD("HERE" << " " << _pkt.seq << " < " << seq_beg); + _have_pkt = false; + if( less_than(_pkt.seq, seq_beg) ) { + ++_stats.nlate; + _stats.nlate_bytes += _pkt.payload_size; + ++_src_stats[_pkt.src].nlate; + _src_stats[_pkt.src].nlate_bytes += _pkt.payload_size; + BF_PRINTD("CONTINUE HERE"); + continue; + } + BF_PRINTD("FINALLY"); + ++_stats.nvalid; + _stats.nvalid_bytes += _pkt.payload_size; + ++_src_stats[_pkt.src].nvalid; + _src_stats[_pkt.src].nvalid_bytes += _pkt.payload_size; + // HACK TODO: src_ngood_bytes should be accumulated locally and + // then atomically updated, like ngood_bytes. The + // current way is not thread-safe. + (*process)(&_pkt, seq_beg, nseq_per_obuf, nbuf, obufs, + local_ngood_bytes, /*local_*/src_ngood_bytes); + } + if( nbuf > 0 ) { atomic_add_and_fetch(ngood_bytes[0], local_ngood_bytes[0]); } + if( nbuf > 1 ) { atomic_add_and_fetch(ngood_bytes[1], local_ngood_bytes[1]); } + return ret; +} + +BFstatus bfPacketCaptureCallbackCreate(BFpacketcapture_callback* obj) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_callback_impl(), + *obj = 0); +} + +BFstatus bfPacketCaptureCallbackDestroy(BFpacketcapture_callback obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + delete obj; + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetSIMPLE(BFpacketcapture_callback obj, + BFpacketcapture_simple_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_simple(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetCHIPS(BFpacketcapture_callback obj, + BFpacketcapture_chips_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_chips(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetSNAP2(BFpacketcapture_callback obj, + BFpacketcapture_snap2_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_snap2(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetIBeam(BFpacketcapture_callback obj, + BFpacketcapture_ibeam_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_ibeam(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetPBeam(BFpacketcapture_callback obj, + BFpacketcapture_pbeam_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_pbeam(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetCOR(BFpacketcapture_callback obj, + BFpacketcapture_cor_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_cor(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetVDIF(BFpacketcapture_callback obj, + BFpacketcapture_vdif_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_vdif(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetTBN(BFpacketcapture_callback obj, + BFpacketcapture_tbn_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_tbn(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetDRX(BFpacketcapture_callback obj, + BFpacketcapture_drx_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_drx(callback); + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureCallbackSetDRX8(BFpacketcapture_callback obj, + BFpacketcapture_drx8_sequence_callback callback) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_drx8(callback); + return BF_STATUS_SUCCESS; +} + +BFpacketcapture_status BFpacketcapture_impl::recv() { + _t0 = std::chrono::high_resolution_clock::now(); + + uint8_t* buf_ptrs[2]; + // Minor HACK to access the buffers in a 2-element queue + buf_ptrs[0] = _bufs.size() > 0 ? (uint8_t*)_bufs.front()->data() : NULL; + buf_ptrs[1] = _bufs.size() > 1 ? (uint8_t*)_bufs.back()->data() : NULL; + + size_t* ngood_bytes_ptrs[2]; + ngood_bytes_ptrs[0] = _buf_ngood_bytes.size() > 0 ? &_buf_ngood_bytes.front() : NULL; + ngood_bytes_ptrs[1] = _buf_ngood_bytes.size() > 1 ? &_buf_ngood_bytes.back() : NULL; + + size_t* src_ngood_bytes_ptrs[2]; + src_ngood_bytes_ptrs[0] = _buf_src_ngood_bytes.size() > 0 ? &_buf_src_ngood_bytes.front()[0] : NULL; + src_ngood_bytes_ptrs[1] = _buf_src_ngood_bytes.size() > 1 ? &_buf_src_ngood_bytes.back()[0] : NULL; + + int state = _capture->run(_seq, + _nseq_per_buf, + _bufs.size(), + buf_ptrs, + ngood_bytes_ptrs, + src_ngood_bytes_ptrs, + _decoder, + _processor); + BF_PRINTD("OUTSIDE"); + if( state & PacketCaptureThread::CAPTURE_ERROR ) { + return BF_CAPTURE_ERROR; + } else if( state & PacketCaptureThread::CAPTURE_INTERRUPTED ) { + return BF_CAPTURE_INTERRUPTED; + } else if( state & PacketCaptureThread::CAPTURE_INTERRUPTED ) { + if( _active ) { + return BF_CAPTURE_ENDED; + } else { + return BF_CAPTURE_NO_DATA; + } + } + const PacketStats* stats = _capture->get_stats(); + _stat_log.update() << "ngood_bytes : " << _ngood_bytes << "\n" + << "nmissing_bytes : " << _nmissing_bytes << "\n" + << "ninvalid : " << stats->ninvalid << "\n" + << "ninvalid_bytes : " << stats->ninvalid_bytes << "\n" + << "nlate : " << stats->nlate << "\n" + << "nlate_bytes : " << stats->nlate_bytes << "\n" + << "nvalid : " << stats->nvalid << "\n" + << "nvalid_bytes : " << stats->nvalid_bytes << "\n"; + + _t1 = std::chrono::high_resolution_clock::now(); + + BFoffset seq0, time_tag=0; + const void* hdr=NULL; + size_t hdr_size=0; + + BFpacketcapture_status ret; + bool was_active = _active; + _active = state & PacketCaptureThread::CAPTURE_SUCCESS; + BF_PRINTD("ACTIVE: " << _active << " WAS ACTIVE: " << was_active); + if( _active ) { + BF_PRINTD("START"); + const PacketDesc* pkt = _capture->get_last_packet(); + BF_PRINTD("PRE-CALL"); + this->on_sequence_active(pkt); + BF_PRINTD("POST-CALL"); + if( !was_active ) { + BF_PRINTD("Beginning of sequence, first pkt seq = " << pkt->seq); + this->on_sequence_start(pkt, &seq0, &time_tag, &hdr, &hdr_size); + this->begin_sequence(seq0, time_tag, hdr, hdr_size); + ret = BF_CAPTURE_STARTED; + } else { + //cout << "Continuing data, seq = " << seq << endl; + if( this->has_sequence_changed(pkt) ) { + this->on_sequence_changed(pkt, &seq0, &time_tag, &hdr, &hdr_size); + this->end_sequence(); + this->begin_sequence(seq0, time_tag, hdr, hdr_size); + ret = BF_CAPTURE_CHANGED; + } else { + ret = BF_CAPTURE_CONTINUED; + } + } + if( _bufs.size() == 2 ) { + this->commit_buf(); + } + this->reserve_buf(); + } else { + + if( was_active ) { + this->flush(); + ret = BF_CAPTURE_ENDED; + } else { + ret = BF_CAPTURE_NO_DATA; + } + } + + _t2 = std::chrono::high_resolution_clock::now(); + _process_time = std::chrono::duration_cast>(_t1-_t0); + _reserve_time = std::chrono::duration_cast>(_t2-_t1); + _perf_log.update() << "acquire_time : " << -1.0 << "\n" + << "process_time : " << _process_time.count() << "\n" + << "reserve_time : " << _reserve_time.count() << "\n"; + + return ret; +} + +BFstatus bfDiskReaderCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core) { + return BFpacketcapture_create(obj, + format, + fd, + ring, + nsrc, + src0, + 9000, + buffer_ntime, + slot_ntime, + sequence_callback, + core, + BF_IO_DISK); +} + +BFstatus bfUdpCaptureCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core) { + return BFpacketcapture_create(obj, + format, + fd, + ring, + nsrc, + src0, + max_payload_size, + buffer_ntime, + slot_ntime, + sequence_callback, + core, + BF_IO_UDP); +} + +BFstatus bfUdpSnifferCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core) { + return BFpacketcapture_create(obj, + format, + fd, + ring, + nsrc, + src0, + max_payload_size, + buffer_ntime, + slot_ntime, + sequence_callback, + core, + BF_IO_SNIFFER); +} + +BFstatus bfUdpVerbsCaptureCreate(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core) { + return BFpacketcapture_create(obj, + format, + fd, + ring, + nsrc, + src0, + max_payload_size, + buffer_ntime, + slot_ntime, + sequence_callback, + core, + BF_IO_VERBS); +} + +BFstatus bfPacketCaptureDestroy(BFpacketcapture obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + delete obj; + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketCaptureRecv(BFpacketcapture obj, + BFpacketcapture_status* result) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN_ELSE(*result = obj->recv(), + *result = BF_CAPTURE_ERROR); +} + +BFstatus bfPacketCaptureFlush(BFpacketcapture obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(obj->flush()); +} + +BFstatus bfPacketCaptureSeek(BFpacketcapture obj, BFoffset offset, BFiowhence whence, BFoffset* position) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(*position = obj->seek(offset, whence)); +} + +BFstatus bfPacketCaptureTell(BFpacketcapture obj, BFoffset* position) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(*position = obj->tell()); +} + +BFstatus bfPacketCaptureEnd(BFpacketcapture obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(obj->end_writing()); +} diff --git a/src/packet_capture.hpp b/src/packet_capture.hpp new file mode 100644 index 000000000..077cb8a2c --- /dev/null +++ b/src/packet_capture.hpp @@ -0,0 +1,1523 @@ +/* + * Copyright (c) 2019-2024, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "assert.hpp" +#include +#include +#include +using bifrost::ring::RingWrapper; +using bifrost::ring::RingWriter; +using bifrost::ring::WriteSpan; +using bifrost::ring::WriteSequence; +#include "proclog.hpp" +#include "Socket.hpp" +#include "formats/formats.hpp" +#include "hw_locality.hpp" + +#include // For ntohs +#include // For recvfrom + +#include +#include +#include +#include // For posix_memalign +#include // For memcpy, memset +#include + +#include +#include +#include +#include + +#if defined __APPLE__ && __APPLE__ + +#define lseek64 lseek + +#endif + +#ifndef BF_HWLOC_ENABLED +#define BF_HWLOC_ENABLED 0 +//#define BF_HWLOC_ENABLED 1 +#endif + +template +inline T atomic_add_and_fetch(T* dst, T val) { + return __sync_add_and_fetch(dst, val); // GCC builtin +} +template +inline T atomic_fetch_and_add(T* dst, T val) { + return __sync_fetch_and_add(dst, val); // GCC builtin +} + +// Wrap-safe comparisons +inline bool greater_equal(uint64_t a, uint64_t b) { return int64_t(a-b) >= 0; } +inline bool less_than( uint64_t a, uint64_t b) { return int64_t(a-b) < 0; } + +template +class AlignedBuffer { + enum { DEFAULT_ALIGNMENT = 4096 }; + T* _buf; + size_t _size; + size_t _alignment; + void alloc() { + int err = ::posix_memalign((void**)&_buf, _alignment, _size*sizeof(T)); + if( err ) { + throw std::runtime_error("Allocation failed"); + } + } + void copy(T const* srcbuf, size_t n) { + ::memcpy(_buf, srcbuf, n*sizeof(T)); + } + void free() { + if( _buf ) { + ::free(_buf); + _buf = 0; + _size = 0; + } + } +public: + //explicit AlignedBuffer(size_t alignment=DEFAULT_ALIGNMENT) + // : _buf(0), _size(0), _alignment(alignment) {} + AlignedBuffer(size_t size=0, size_t alignment=DEFAULT_ALIGNMENT) + : _buf(0), _size(size), _alignment(alignment) { + this->alloc(); + } + AlignedBuffer(AlignedBuffer const& other) + : _buf(0), _size(other.size), _alignment(other.alignment) { + this->alloc(); + this->copy(other._buf, other._size); + } + AlignedBuffer& operator=(AlignedBuffer const& other) { + if( &other != this ) { + this->free(); + _size = other.size; + _alignment = other.alignment; + this->alloc(); + this->copy(other._buf, other._size); + } + return *this; + } + ~AlignedBuffer() { + this->free(); + } + inline void swap(AlignedBuffer & other) { + std::swap(_buf, other._buf); + std::swap(_size, other._size); + std::swap(_alignment, other._alignment); + } + inline void resize(size_t n) { + if( n <= _size ) { + _size = n; + } else { + AlignedBuffer tmp(n, _alignment); + tmp.copy(&_buf[0], _size); + tmp.swap(*this); + } + } + inline size_t size() const { return _size; } + inline size_t alignment() const { return _alignment; } + inline T & operator[](size_t i) { return _buf[i]; } + inline T const& operator[](size_t i) const { return _buf[i]; } +}; + +class PacketCaptureMethod: public BoundThread { +protected: + int _fd; + size_t _pkt_size_max; + AlignedBuffer _buf; + BFiomethod _io_method; + int _core; +public: + PacketCaptureMethod(int fd, size_t pkt_size_max=9000, BFiomethod io_method=BF_IO_GENERIC, int core=-1) + : BoundThread(core), _fd(fd), _pkt_size_max(pkt_size_max), _buf(pkt_size_max), _io_method(io_method), _core(core) {} + virtual int recv_packet(uint8_t** pkt_ptr, int flags=0) { + return 0; + } + virtual const char* get_name() { return "generic_capture"; } + inline const size_t get_max_size() { return _pkt_size_max; } + inline const BFiomethod get_io_method() { return _io_method; } + virtual inline BFoffset seek(BFoffset offset, BFiowhence whence=BF_WHENCE_CUR) { return 0; } + inline BFoffset tell() { return this->seek(0, BF_WHENCE_CUR); } +}; + +class DiskPacketReader : public PacketCaptureMethod { +public: + DiskPacketReader(int fd, size_t pkt_size_max=9000, int core=-1) + : PacketCaptureMethod(fd, pkt_size_max, BF_IO_DISK, core) {} + int recv_packet(uint8_t** pkt_ptr, int flags=0) { + *pkt_ptr = &_buf[0]; + return ::read(_fd, &_buf[0], _buf.size()); + } + inline const char* get_name() { return "disk_reader"; } + inline BFoffset seek(BFoffset offset, BFiowhence whence=BF_WHENCE_CUR) { + return ::lseek64(_fd, offset, whence); + } +}; + +// TODO: The VMA API is returning unaligned buffers, which prevents use of SSE +#ifndef BF_VMA_ENABLED +#define BF_VMA_ENABLED 0 +#endif + +#if BF_VMA_ENABLED +#include +class VMAReceiver { + int _fd; + vma_api_t* _api; + vma_packet_t* _pkt; + inline void clean_cache() { + if( _pkt ) { + _api->free_packets(_fd, _pkt, 1); + _pkt = 0; + } + } +public: + VMAReceiver(int fd) + : _fd(fd), _api(vma_get_api()), _pkt(0) {} + VMAReceiver(VMAReceiver const& other) + : _fd(other._fd), _api(other._api), _pkt(0) {} + VMAReceiver& operator=(VMAReceiver const& other) { + if( &other != this ) { + this->clean_cache(); + _fd = other._fd; + _api = other._api; + } + return *this; + } + ~VMAReceiver() { this->clean_cache(); } + inline int recv_packet(uint8_t* buf, size_t bufsize, uint8_t** pkt_ptr, int flags=0) { + this->clean_cache(); + int ret = _api->recvfrom_zcopy(_fd, buf, bufsize, &flags, 0, 0); + if( ret < 0 ) { + return ret; + } + if( flags & MSG_VMA_ZCOPY ) { + _pkt = &((vma_packets_t*)buf)->pkts[0]; + *pkt_ptr = (uint8_t*)_pkt->iov[0].iov_base; + } else { + *pkt_ptr = buf; + } + return ret; + } + inline operator bool() const { return _api != NULL; } +}; +#endif // BF_VMA_ENABLED + +class UDPPacketReceiver : public PacketCaptureMethod { +#if BF_VMA_ENABLED + VMAReceiver _vma; +#endif +public: + UDPPacketReceiver(int fd, size_t pkt_size_max=JUMBO_FRAME_SIZE, int core=-1) + : PacketCaptureMethod(fd, pkt_size_max, BF_IO_UDP, core) +#if BF_VMA_ENABLED + , _vma(fd) +#endif + {} + inline int recv_packet(uint8_t** pkt_ptr, int flags=0) { + +#if BF_VMA_ENABLED + if( _vma ) { + *pkt_ptr = 0; + return _vma.recv_packet(&_buf[0], _buf.size(), pkt_ptr, flags); + } else { +#endif + *pkt_ptr = &_buf[0]; + return ::recvfrom(_fd, &_buf[0], _buf.size(), flags, 0, 0); +#if BF_VMA_ENABLED + } +#endif + } + inline const char* get_name() { return "udp_capture"; } +}; + +class UDPPacketSniffer : public PacketCaptureMethod { +#if BF_VMA_ENABLED + VMAReceiver _vma; +#endif +public: + UDPPacketSniffer(int fd, size_t pkt_size_max=JUMBO_FRAME_SIZE, int core=-1) + : PacketCaptureMethod(fd, pkt_size_max, BF_IO_SNIFFER, core) +#if BF_VMA_ENABLED + , _vma(fd) +#endif + {} + inline int recv_packet(uint8_t** pkt_ptr, int flags=0) { +#if BF_VMA_ENABLED + if( _vma ) { + *pkt_ptr = 0; + int rc = _vma.recv_packet(&_buf[0], _buf.size(), pkt_ptr, flags) - 28; + *pkt_ptr = *(pkt_ptr + 28); + return rc; + } else { +#endif + *pkt_ptr = &_buf[28]; // Offset for the IP+UDP headers + return ::recvfrom(_fd, &_buf[0], _buf.size(), flags, 0, 0) - 28; +#if BF_VMA_ENABLED + } +#endif + } + inline const char* get_name() { return "udp_sniffer"; } +}; + +#if defined BF_VERBS_ENABLED && BF_VERBS_ENABLED +#include "ib_verbs.hpp" + +class UDPVerbsReceiver : public PacketCaptureMethod { + Verbs _ibv; +public: + UDPVerbsReceiver(int fd, size_t pkt_size_max=JUMBO_FRAME_SIZE, int core=-1) + : PacketCaptureMethod(fd, pkt_size_max, BF_IO_VERBS, core), _ibv(fd, pkt_size_max) {} + inline int recv_packet(uint8_t** pkt_ptr, int flags=0) { + *pkt_ptr = 0; + return _ibv.recv_packet(pkt_ptr, flags); + } + inline const char* get_name() { return "udp_verbs_capture"; } +}; +#endif // BF_VERBS_ENABLED + +struct PacketStats { + size_t ninvalid; + size_t ninvalid_bytes; + size_t nlate; + size_t nlate_bytes; + size_t nvalid; + size_t nvalid_bytes; +}; + +class PacketCaptureThread : public BoundThread { +private: + PacketCaptureMethod* _method; + PacketStats _stats; + std::vector _src_stats; + bool _have_pkt; + PacketDesc _pkt; + int _core; + +public: + enum { + CAPTURE_SUCCESS = 1 << 0, + CAPTURE_TIMEOUT = 1 << 1, + CAPTURE_INTERRUPTED = 1 << 2, + CAPTURE_NO_DATA = 1 << 3, + CAPTURE_ERROR = 1 << 4 + }; + PacketCaptureThread(PacketCaptureMethod* method, int nsrc, int core=-1) + : BoundThread(core), _method(method), _src_stats(nsrc), + _have_pkt(false), _core(core) { + this->reset_stats(); + } + template + int run(uint64_t seq_beg, + uint64_t nseq_per_obuf, + int nbuf, + uint8_t* obufs[], + size_t* ngood_bytes[], + size_t* src_ngood_bytes[], + PDC* decode, + PPC* process); + inline const char* get_name() { return _method->get_name(); } + inline const size_t get_max_size() { return _method->get_max_size(); } + inline const BFiomethod get_io_method() { return _method->get_io_method(); } + inline const int get_core() { return _core; } + inline BFoffset seek(BFoffset offset, BFiowhence whence=BF_WHENCE_CUR) { return _method->seek(offset, whence); } + inline BFoffset tell() { return _method->tell(); } + inline const PacketDesc* get_last_packet() const { + return _have_pkt ? &_pkt : NULL; + } + inline void reset_last_packet() { + _have_pkt = false; + } + inline const PacketStats* get_stats() const { return &_stats; } + inline const PacketStats* get_stats(int src) const { return &_src_stats[src]; } + inline void reset_stats() { + ::memset(&_stats, 0, sizeof(_stats)); + ::memset(&_src_stats[0], 0, _src_stats.size()*sizeof(PacketStats)); + } +}; + +inline uint64_t round_up(uint64_t val, uint64_t mult) { + return (val == 0 ? + 0 : + ((val-1)/mult+1)*mult); +} +inline uint64_t round_nearest(uint64_t val, uint64_t mult) { + return (2*val/mult+1)/2*mult; +} + +class BFpacketcapture_callback_impl { + BFpacketcapture_simple_sequence_callback _simple_callback; + BFpacketcapture_chips_sequence_callback _chips_callback; + BFpacketcapture_snap2_sequence_callback _snap2_callback; + BFpacketcapture_ibeam_sequence_callback _ibeam_callback; + BFpacketcapture_pbeam_sequence_callback _pbeam_callback; + BFpacketcapture_cor_sequence_callback _cor_callback; + BFpacketcapture_vdif_sequence_callback _vdif_callback; + BFpacketcapture_tbn_sequence_callback _tbn_callback; + BFpacketcapture_drx_sequence_callback _drx_callback; + BFpacketcapture_drx8_sequence_callback _drx8_callback; +public: + BFpacketcapture_callback_impl() + : _simple_callback(NULL), _chips_callback(NULL), _ibeam_callback(NULL), + _pbeam_callback(NULL), _cor_callback(NULL), _vdif_callback(NULL), + _tbn_callback(NULL), _drx_callback(NULL), _drx8_callback(NULL), + _snap2_callback(NULL) {} + inline void set_simple(BFpacketcapture_simple_sequence_callback callback) { + _simple_callback = callback; + } + inline BFpacketcapture_simple_sequence_callback get_simple() { + return _simple_callback; + } + inline void set_chips(BFpacketcapture_chips_sequence_callback callback) { + _chips_callback = callback; + } + inline BFpacketcapture_chips_sequence_callback get_chips() { + return _chips_callback; + } + inline void set_snap2(BFpacketcapture_snap2_sequence_callback callback) { + _snap2_callback = callback; + } + inline BFpacketcapture_snap2_sequence_callback get_snap2() { + return _snap2_callback; + } + inline void set_ibeam(BFpacketcapture_ibeam_sequence_callback callback) { + _ibeam_callback = callback; + } + inline BFpacketcapture_ibeam_sequence_callback get_ibeam() { + return _ibeam_callback; + } + inline void set_pbeam(BFpacketcapture_pbeam_sequence_callback callback) { + _pbeam_callback = callback; + } + inline BFpacketcapture_pbeam_sequence_callback get_pbeam() { + return _pbeam_callback; + } + inline void set_cor(BFpacketcapture_cor_sequence_callback callback) { + _cor_callback = callback; + } + inline BFpacketcapture_cor_sequence_callback get_cor() { + return _cor_callback; + } + inline void set_vdif(BFpacketcapture_vdif_sequence_callback callback) { + _vdif_callback = callback; + } + inline BFpacketcapture_vdif_sequence_callback get_vdif() { + return _vdif_callback; + } + inline void set_tbn(BFpacketcapture_tbn_sequence_callback callback) { + _tbn_callback = callback; + } + inline BFpacketcapture_tbn_sequence_callback get_tbn() { + return _tbn_callback; + } + inline void set_drx(BFpacketcapture_drx_sequence_callback callback) { + _drx_callback = callback; + } + inline BFpacketcapture_drx_sequence_callback get_drx() { + return _drx_callback; + } + inline void set_drx8(BFpacketcapture_drx8_sequence_callback callback) { + _drx8_callback = callback; + } + inline BFpacketcapture_drx8_sequence_callback get_drx8() { + return _drx8_callback; + } +}; + +class BFpacketcapture_impl { +protected: + std::string _name; + PacketCaptureThread* _capture; + PacketDecoder* _decoder; + PacketProcessor* _processor; + ProcLog _bind_log; + ProcLog _out_log; + ProcLog _size_log; + ProcLog _stat_log; + ProcLog _perf_log; + pid_t _pid; + + int _nsrc; + int _nseq_per_buf; + int _slot_ntime; + BFoffset _seq; + int _chan0; + int _nchan; + int _payload_size; + bool _active; + +private: + std::chrono::high_resolution_clock::time_point _t0; + std::chrono::high_resolution_clock::time_point _t1; + std::chrono::high_resolution_clock::time_point _t2; + std::chrono::duration _process_time; + std::chrono::duration _reserve_time; + + RingWrapper _ring; + RingWriter _oring; + std::queue > _bufs; + std::queue _buf_ngood_bytes; + std::queue > _buf_src_ngood_bytes; + std::shared_ptr _sequence; + size_t _ngood_bytes; + size_t _nmissing_bytes; + + inline size_t bufsize(int payload_size=-1) { + if( payload_size == -1 ) { + payload_size = _payload_size; + } + return _nseq_per_buf * _nsrc * payload_size * BF_UNPACK_FACTOR; + } + inline void reserve_buf() { + _buf_ngood_bytes.push(0); + _buf_src_ngood_bytes.push(std::vector(_nsrc, 0)); + size_t size = this->bufsize(); + // TODO: Can make this simpler? + _bufs.push(std::shared_ptr(new bifrost::ring::WriteSpan(_oring, size))); + } + inline void commit_buf() { + size_t expected_bytes = _bufs.front()->size(); + + for( int src=0; src<_nsrc; ++src ) { + // TODO: This assumes all sources contribute equally; should really + // allow non-uniform partitioning. + size_t src_expected_bytes = expected_bytes / _nsrc; + size_t src_ngood_bytes = _buf_src_ngood_bytes.front()[src]; + size_t src_nmissing_bytes = src_expected_bytes - src_ngood_bytes; + // Detect >50% missing data from this source + if( src_nmissing_bytes > src_ngood_bytes ) { + // Zero-out this source's contribution to the buffer + uint8_t* data = (uint8_t*)_bufs.front()->data(); + _processor->blank_out_source(data, src, _nsrc, + _nchan, _nseq_per_buf); + } + } + _buf_src_ngood_bytes.pop(); + + _ngood_bytes += _buf_ngood_bytes.front(); + //_nmissing_bytes += _bufs.front()->size() - _buf_ngood_bytes.front(); + //// HACK TESTING 15/16 correction for missing roach11 + //_nmissing_bytes += _bufs.front()->size()*15/16 - _buf_ngood_bytes.front(); + _nmissing_bytes += expected_bytes - _buf_ngood_bytes.front(); + _buf_ngood_bytes.pop(); + + _bufs.front()->commit(); + _bufs.pop(); + _seq += _nseq_per_buf; + } + inline void begin_sequence(BFoffset seq0, BFoffset time_tag, const void* hdr, size_t hdr_size) { + const char* name = ""; + int nringlet = 1; + _sequence.reset(new WriteSequence(_oring, name, time_tag, + hdr_size, hdr, nringlet)); + } + inline void end_sequence() { + _sequence.reset(); // Note: This is releasing the shared_ptr + } + virtual void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) {} + virtual void on_sequence_active(const PacketDesc* pkt) {} + virtual inline bool has_sequence_changed(const PacketDesc* pkt) { return false; } + virtual void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) {} +public: + inline BFpacketcapture_impl(PacketCaptureThread* capture, + PacketDecoder* decoder, + PacketProcessor* processor, + BFring ring, + int nsrc, + int buffer_ntime, + int slot_ntime) + : _name(capture->get_name()), _capture(capture), _decoder(decoder), _processor(processor), + _bind_log(_name+"/bind"), + _out_log(_name+"/out"), + _size_log(_name+"/sizes"), + _stat_log(_name+"/stats"), + _perf_log(_name+"/perf"), + _nsrc(nsrc), _nseq_per_buf(buffer_ntime), _slot_ntime(slot_ntime), + _seq(), _chan0(), _nchan(), _active(false), + _ring(ring), _oring(_ring), + // TODO: Add reset method for stats + _ngood_bytes(0), _nmissing_bytes(0) { + size_t contig_span = this->bufsize(_capture->get_max_size()); + // Note: 2 write bufs may be open for writing at one time + size_t total_span = contig_span * 4; + size_t nringlet_max = 1; + _ring.resize(contig_span, total_span, nringlet_max); + _bind_log.update("ncore : %i\n" + "core0 : %i\n", + 1, _capture->get_core()); + _out_log.update("nring : %i\n" + "ring0 : %s\n", + 1, _ring.name()); + _size_log.update("nsrc : %i\n" + "nseq_per_buf : %i\n" + "slot_ntime : %i\n", + _nsrc, _nseq_per_buf, _slot_ntime); + } + virtual ~BFpacketcapture_impl() {} + inline void flush() { + while( _bufs.size() ) { + this->commit_buf(); + } + if( _sequence ) { + this->end_sequence(); + } + } + inline BFoffset seek(BFoffset offset, BFiowhence whence=BF_WHENCE_CUR) { + BF_ASSERT(_capture->get_io_method() == BF_IO_DISK, BF_STATUS_UNSUPPORTED); + BFoffset moved = _capture->seek(offset, whence); + this->flush(); + return moved; + } + inline BFoffset tell() { + BF_ASSERT(_capture->get_io_method() == BF_IO_DISK, BF_STATUS_UNSUPPORTED); + return _capture->tell(); + } + inline void end_writing() { + this->flush(); + _oring.close(); + } + BFpacketcapture_status recv(); +}; + +class BFpacketcapture_simple_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_simple_sequence_callback _sequence_callback; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + // TODO: Might be safer to round to nearest here, but the current firmware + // always starts things ~3 seq's before the 1sec boundary anyway. + //seq = round_up(pkt->seq, _slot_ntime); + //*_seq = round_nearest(pkt->seq, _slot_ntime); + _seq = round_up(pkt->seq, _slot_ntime); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return 0; + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + _chan0, + _nchan, + _nsrc, + time_tag, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + } +public: + inline BFpacketcapture_simple_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_simple()) { + _decoder = new SIMPLEDecoder(nsrc, src0); + _processor = new SIMPLEProcessor(); + _type_log.update("type : %s\n", "simple"); + } +}; +class BFpacketcapture_chips_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_chips_sequence_callback _sequence_callback; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + // TODO: Might be safer to round to nearest here, but the current firmware + // always starts things ~3 seq's before the 1sec boundary anyway. + //seq = round_up(pkt->seq, _slot_ntime); + //*_seq = round_nearest(pkt->seq, _slot_ntime); + _seq = round_up(pkt->seq, _slot_ntime); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return (pkt->chan0 != _chan0) \ + || (pkt->nchan != _nchan); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + _chan0 = pkt->chan0; + _nchan = pkt->nchan; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + _chan0, + _nchan, + _nsrc, + time_tag, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "nchan : " << _nchan << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_chips_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_chips()) { + _decoder = new CHIPSDecoder(nsrc, src0); + _processor = new CHIPSProcessor(); + _type_log.update("type : %s\n", "chips"); + } +}; + +class BFpacketcapture_snap2_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + BFoffset _last_seq; + BFoffset _last_time_tag; + + BFpacketcapture_snap2_sequence_callback _sequence_callback; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + // Has the configuration changed? I.e., different channels being sent. + inline bool has_sequence_changed(const PacketDesc* pkt) { + // TODO: Decide what a sequence actually is! + // Currently a new sequence starts whenever a block finishes and the next + // packet isn't from the next block + // TODO. Is this actually reasonable? Does it recover from upstream resyncs? + bool is_new_seq = false; + if ( (_last_time_tag != pkt->time_tag) || (pkt->seq != _last_seq + _nseq_per_buf) ) { + // We could have a packet sequence number which isn't what we expect + // but is only wrong because of missing packets. Set an upper bound on + // two slots of loss + if (pkt->seq > _last_seq + 2*_slot_ntime) { + is_new_seq = true; + this->flush(); + } + } + _last_seq = pkt->seq; + return is_new_seq; + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + _seq = round_up(pkt->seq, _slot_ntime); + *time_tag = (BFoffset) pkt->time_tag; + _last_time_tag = pkt->time_tag; + _last_seq = _seq; + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + _chan0 = pkt->chan0; + _nchan = pkt->nchan; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + pkt->tuning, // Hacked to contain chan0 + _nchan, + _nsrc, + time_tag, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "nchan : " << _nchan << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_snap2_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_snap2()) { + _decoder = new SNAP2Decoder(nsrc, src0); + _processor = new SNAP2Processor(); + _type_log.update("type : %s\n", "snap2"); + } +}; + +template +class BFpacketcapture_ibeam_impl : public BFpacketcapture_impl { + uint8_t _nbeam = B; + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_ibeam_sequence_callback _sequence_callback; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + // TODO: Might be safer to round to nearest here, but the current firmware + // always starts things ~3 seq's before the 1sec boundary anyway. + //seq = round_up(pkt->seq, _slot_ntime); + //*_seq = round_nearest(pkt->seq, _slot_ntime); + _seq = round_up(pkt->seq, _slot_ntime); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return (pkt->chan0 != _chan0) \ + || (pkt->nchan != _nchan); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + _chan0 = pkt->chan0; + _nchan = pkt->nchan; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + _chan0, + _nchan*_nsrc, + _nbeam, + time_tag, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "nchan : " << _nchan << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_ibeam_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_ibeam()) { + _decoder = new IBeamDecoder(nsrc, src0); + _processor = new IBeamProcessor(); + _type_log.update("type : %s%i\n", "ibeam", _nbeam); + } +}; + +class BFpacketcapture_pbeam_impl : public BFpacketcapture_impl { + uint8_t _nbeam; + uint8_t _navg; + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_pbeam_sequence_callback _sequence_callback; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + // TODO: Might be safer to round to nearest here, but the current firmware + // always starts things ~3 seq's before the 1sec boundary anyway. + //seq = round_up(pkt->seq, _slot_ntime); + _seq = round_nearest(pkt->seq, _slot_ntime); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return (pkt->chan0 != _chan0) \ + || (pkt->nchan != _nchan) \ + || (pkt->decimation != _navg); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + *time_tag = pkt->time_tag; + _chan0 = pkt->chan0; + _nchan = pkt->nchan; + _nbeam = pkt->beam; + _navg = pkt->decimation; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + *time_tag, + _navg, + _chan0, + _nchan*_nsrc/_nbeam, + _nbeam, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "nchan : " << _nchan << "\n" + << "nbeam : " << _nbeam << "\n" + << "navg : " << _navg << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_pbeam_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_pbeam()) { + _decoder = new PBeamDecoder(nsrc, src0); + _processor = new PBeamProcessor(); + _type_log.update("type : %s\n", "pbeam"); + } +}; + +class BFpacketcapture_cor_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_cor_sequence_callback _sequence_callback; + + BFoffset _time_tag; + int _navg; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + _seq = round_nearest(pkt->seq, _nseq_per_buf); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest time_tag, tuning = " << pkt->time_tag << ", " << pkt->tuning << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return ((pkt->chan0 != _chan0) \ + || (pkt->nchan != _nchan) \ + || (pkt->decimation != _navg)); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + *time_tag = pkt->time_tag; + _chan0 = pkt->chan0; + _nchan = pkt->nchan; + _navg = pkt->decimation; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + *time_tag, + _chan0, + _nchan*((pkt->tuning >> 8) & 0xFF), + _navg, + _nsrc/((pkt->tuning >> 8) & 0xFF), + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "nchan : " << _nchan*((pkt->tuning >> 8) & 0xFF) << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_cor_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_cor()) { + _decoder = new CORDecoder(nsrc, src0); + _processor = new CORProcessor(); + _type_log.update("type : %s\n", "cor"); + } +}; + +class BFpacketcapture_vdif_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_vdif_sequence_callback _sequence_callback; + + BFoffset _time_tag; + int _tuning; + int _sample_rate; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + _seq = round_nearest(pkt->seq, _nseq_per_buf); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest time_tag, tuning = " << pkt->time_tag << ", " << pkt->tuning << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return ((pkt->chan0 != _chan0) \ + || (pkt->nchan != _nchan) \ + || (pkt->tuning != _tuning)); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + *time_tag = pkt->time_tag; + _chan0 = pkt->chan0; + _nchan = pkt->nchan; + _tuning = pkt->tuning; + _sample_rate = pkt->sync; + _payload_size = pkt->payload_size; + + int ref_epoch = (_tuning >> 16) & 0xFF; + int bit_depth = (_tuning >> 8) & 0xFF; + int is_complex = (_tuning & 1); + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + *time_tag, + ref_epoch, + _sample_rate, + _chan0, + bit_depth, + is_complex, + _nsrc, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "nchan : " << _chan0 << "\n" + << "bitdepth : " << bit_depth << "\n" + << "complex : " << is_complex << "\n" + << "payload_size : " << (_payload_size*8) << "\n"; + } +public: + inline BFpacketcapture_vdif_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_vdif()) { + _decoder = new VDIFDecoder(nsrc, src0); + _processor = new VDIFProcessor(); + _type_log.update("type : %s\n", "vdif"); + } +}; + +class BFpacketcapture_tbn_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_tbn_sequence_callback _sequence_callback; + + BFoffset _time_tag; + uint16_t _decim; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + _seq = round_nearest(pkt->seq, _nseq_per_buf); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest time_tag, tuning = " << pkt->time_tag << ", " << pkt->tuning << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return ( (pkt->tuning != _chan0 ) + || ( pkt->decimation != _decim) ); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + //cout << "Sequence changed" << endl; + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + *time_tag = pkt->time_tag; + _time_tag = pkt->time_tag; + _decim = pkt->decimation; + _chan0 = pkt->tuning; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + *time_tag, + _decim, + pkt->tuning, + _nsrc, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_tbn_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_tbn()), + _decim(0) { + _decoder = new TBNDecoder(nsrc, src0); + _processor = new TBNProcessor(); + _type_log.update("type : %s\n", "tbn"); + } +}; + +class BFpacketcapture_drx_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_drx_sequence_callback _sequence_callback; + + BFoffset _time_tag; + uint16_t _decim; + int _chan1; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + _seq = round_nearest(pkt->seq, _nseq_per_buf); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return ( (pkt->tuning != _chan0) + || (pkt->tuning1 != _chan1) + || (pkt->decimation != _decim) ); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + *time_tag = pkt->time_tag; + _time_tag = pkt->time_tag; + _chan0 = pkt->tuning; + _chan1 = pkt->tuning1; + if( _nsrc == 2 ) { + _chan0 = std::max(_chan0, _chan1); + _chan1 = 0; + } + _decim = pkt->decimation; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + *time_tag, + _decim, + _chan0, + _chan1, + _nsrc, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "chan1 : " << _chan1 << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_drx_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_drx()), + _decim(0), _chan1(0) { + _decoder = new DRXDecoder(nsrc, src0); + _processor = new DRXProcessor(); + _type_log.update("type : %s\n", "drx"); + } +}; + +class BFpacketcapture_drx8_impl : public BFpacketcapture_impl { + ProcLog _type_log; + ProcLog _chan_log; + + BFpacketcapture_drx8_sequence_callback _sequence_callback; + + BFoffset _time_tag; + uint16_t _decim; + int _chan1; + + void on_sequence_start(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size ) { + _seq = round_nearest(pkt->seq, _nseq_per_buf); + this->on_sequence_changed(pkt, seq0, time_tag, hdr, hdr_size); + } + void on_sequence_active(const PacketDesc* pkt) { + if( pkt ) { + //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; + } + else { + //cout << "No latest packet" << endl; + } + } + inline bool has_sequence_changed(const PacketDesc* pkt) { + return ( (pkt->tuning != _chan0) + || (pkt->tuning1 != _chan1) + || (pkt->decimation != _decim) ); + } + void on_sequence_changed(const PacketDesc* pkt, BFoffset* seq0, BFoffset* time_tag, const void** hdr, size_t* hdr_size) { + *seq0 = _seq;// + _nseq_per_buf*_bufs.size(); + *time_tag = pkt->time_tag; + _time_tag = pkt->time_tag; + _chan0 = pkt->tuning; + _chan1 = pkt->tuning1; + if( _nsrc == 2 ) { + _chan0 = std::max(_chan0, _chan1); + _chan1 = 0; + } + _decim = pkt->decimation; + _payload_size = pkt->payload_size; + + if( _sequence_callback ) { + int status = (*_sequence_callback)(*seq0, + *time_tag, + _decim, + _chan0, + _chan1, + _nsrc, + hdr, + hdr_size); + if( status != 0 ) { + // TODO: What to do here? Needed? + throw std::runtime_error("BAD HEADER CALLBACK STATUS"); + } + } else { + // Simple default for easy testing + *time_tag = *seq0; + *hdr = NULL; + *hdr_size = 0; + } + + _chan_log.update() << "chan0 : " << _chan0 << "\n" + << "chan1 : " << _chan1 << "\n" + << "payload_size : " << _payload_size << "\n"; + } +public: + inline BFpacketcapture_drx8_impl(PacketCaptureThread* capture, + BFring ring, + int nsrc, + int src0, + int buffer_ntime, + int slot_ntime, + BFpacketcapture_callback sequence_callback) + : BFpacketcapture_impl(capture, nullptr, nullptr, ring, nsrc, buffer_ntime, slot_ntime), + _type_log((std::string(capture->get_name())+"/type").c_str()), + _chan_log((std::string(capture->get_name())+"/chans").c_str()), + _sequence_callback(sequence_callback->get_drx8()), + _decim(0), _chan1(0) { + _decoder = new DRX8Decoder(nsrc, src0); + _processor = new DRX8Processor(); + _type_log.update("type : %s\n", "drx8"); + } +}; + +BFstatus BFpacketcapture_create(BFpacketcapture* obj, + const char* format, + int fd, + BFring ring, + BFsize nsrc, + BFsize src0, + BFsize max_payload_size, + BFsize buffer_ntime, + BFsize slot_ntime, + BFpacketcapture_callback sequence_callback, + int core, + BFiomethod backend) { + BF_ASSERT(obj, BF_STATUS_INVALID_POINTER); + + if( std::string(format).substr(0, 6) == std::string("simple") ) { + if( backend == BF_IO_DISK ) { + // Need to know how much to read at a time + int nchan = 1; + max_payload_size = 8200; + } + } else if( std::string(format).substr(0, 5) == std::string("chips") ) { + if( backend == BF_IO_DISK ) { + // Need to know how much to read at a time + int nchan = std::atoi((std::string(format).substr(6, std::string(format).length())).c_str()); + max_payload_size = sizeof(chips_hdr_type) + (4*nchan); + } + } else if( std::string(format).substr(0, 5) == std::string("ibeam") ) { + if( backend == BF_IO_DISK ) { + // Need to know how much to read at a time + int nbeam = std::atoi((std::string(format).substr(5, 1).c_str())); + int nchan = std::atoi((std::string(format).substr(7, std::string(format).length())).c_str()); + max_payload_size = sizeof(ibeam_hdr_type) + (8*2*nbeam*nchan); + } + } else if( std::string(format).substr(0, 5) == std::string("pbeam") ) { + if( backend == BF_IO_DISK ) { + // Need to know how much to read at a time + int nchan = std::atoi((std::string(format).substr(6, std::string(format).length())).c_str()); + max_payload_size = sizeof(pbeam_hdr_type) + (4*4*nchan); + } + } else if(std::string(format).substr(0, 3) == std::string("cor") ) { + if( backend == BF_IO_DISK ) { + // Need to know how much to read at a time + int nchan = std::atoi((std::string(format).substr(4, std::string(format).length())).c_str()); + max_payload_size = sizeof(cor_hdr_type) + (8*4*nchan); + } + } else if(std::string(format).substr(0, 4) == std::string("vdif") ) { + if( backend == BF_IO_DISK ) { + // Need to know how much to read at a time + int nchan = std::atoi((std::string(format).substr(5, std::string(format).length())).c_str()); + max_payload_size = nchan; + } + } else if( format == std::string("tbn") ) { + max_payload_size = TBN_FRAME_SIZE; + } else if( format == std::string("drx") ) { + max_payload_size = DRX_FRAME_SIZE; + } else if( format == std::string("drx8") ) { + max_payload_size = DRX8_FRAME_SIZE; + } + + PacketCaptureMethod* method; + if( backend == BF_IO_DISK ) { + method = new DiskPacketReader(fd, max_payload_size, core); + } else if( backend == BF_IO_UDP ) { + method = new UDPPacketReceiver(fd, max_payload_size, core); + } else if( backend == BF_IO_SNIFFER ) { + method = new UDPPacketSniffer(fd, max_payload_size, core); +#if defined BF_VERBS_ENABLED && BF_VERBS_ENABLED + } else if( backend == BF_IO_VERBS ) { + method = new UDPVerbsReceiver(fd, max_payload_size, core); +#endif + } else { + return BF_STATUS_UNSUPPORTED; + } + PacketCaptureThread* capture = new PacketCaptureThread(method, nsrc, core); + if (std::string(format).substr(0, 6) == std::string("simple") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_simple_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + + } else if( std::string(format).substr(0, 5) == std::string("chips") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_chips_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else if( std::string(format).substr(0, 5) == std::string("snap2") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_snap2_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); +#define MATCH_IBEAM_MODE(NBEAM) \ + } else if( std::string(format).substr(0, 6) == std::string("ibeam"#NBEAM) ) { \ + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_ibeam_impl(capture, ring, nsrc, src0, \ + buffer_ntime, slot_ntime, \ + sequence_callback), \ + *obj = 0); + MATCH_IBEAM_MODE(1) + MATCH_IBEAM_MODE(2) + MATCH_IBEAM_MODE(3) + MATCH_IBEAM_MODE(4) +#undef MATCH_IBEAM_MODE + } else if( std::string(format).substr(0, 5) == std::string("pbeam") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_pbeam_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else if( std::string(format).substr(0, 3) == std::string("cor") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_cor_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else if( std::string(format).substr(0, 4) == std::string("vdif") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_vdif_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else if( format == std::string("tbn") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_tbn_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else if( format == std::string("drx") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_drx_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else if( format == std::string("drx8") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketcapture_drx8_impl(capture, ring, nsrc, src0, + buffer_ntime, slot_ntime, + sequence_callback), + *obj = 0); + } else { + return BF_STATUS_UNSUPPORTED; + } +} diff --git a/src/packet_writer.cpp b/src/packet_writer.cpp new file mode 100644 index 000000000..6acf4fbce --- /dev/null +++ b/src/packet_writer.cpp @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "packet_writer.hpp" + +#define BF_JAYCE_DEBUG 0 + +#if BF_JAYCE_DEBUG +#define BF_PRINTD(stmt) \ + std::cout << stmt << std::endl +#else // not BF_JAYCE_DEBUG +#define BF_PRINTD(stmt) +#endif + +BFstatus BFpacketwriter_impl::send(BFheaderinfo info, + BFoffset seq, + BFoffset seq_increment, + BFoffset src, + BFoffset src_increment, + BFarray const* in) { + BF_ASSERT(info, BF_STATUS_INVALID_HANDLE); + BF_ASSERT(in, BF_STATUS_INVALID_POINTER); + BF_ASSERT(in->dtype == _dtype, BF_STATUS_INVALID_DTYPE); + BF_ASSERT(in->ndim == 3, BF_STATUS_INVALID_SHAPE); + BF_ASSERT(in->shape[2] == _nsamples, BF_STATUS_INVALID_SHAPE); + BF_ASSERT(is_contiguous(in), BF_STATUS_UNSUPPORTED_STRIDE); + BF_ASSERT(space_accessible_from(in->space, BF_SPACE_SYSTEM), + BF_STATUS_UNSUPPORTED_SPACE); + + PacketDesc* hdr_base = info->get_description(); + + int i, j; + int hdr_size = _filler->get_size(); + int data_size = (BF_DTYPE_NBIT(in->dtype)/8) * _nsamples; + int npackets = in->shape[0]*in->shape[1]; + + if( hdr_size != _last_size || npackets > _last_count ) { + if( _pkt_hdrs ) { + ::munlock(_pkt_hdrs, _last_count*_last_size*sizeof(char)); + free(_pkt_hdrs); + } + + _last_size = hdr_size; + _last_count = npackets; + _pkt_hdrs = (char*) malloc(npackets*hdr_size*sizeof(char)); + ::mlock(_pkt_hdrs, npackets*hdr_size*sizeof(char)); + } + + for(i=0; ishape[0]; i++) { + hdr_base->seq = seq + i*seq_increment; + for(j=0; jshape[1]; j++) { + hdr_base->src = src + j*src_increment; + (*_filler)(hdr_base, _framecount, _pkt_hdrs+hdr_size*(i*in->shape[1]+j)); + } + _framecount++; + } + + _writer->send(_pkt_hdrs, hdr_size, (char*) in->data, data_size, npackets); + this->update_stats_log(); + + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoCreate(BFheaderinfo* obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN_ELSE(*obj = new BFheaderinfo_impl(), + *obj = 0); +} + +BFstatus bfHeaderInfoDestroy(BFheaderinfo obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + delete obj; + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoSetNSrc(BFheaderinfo obj, + int nsrc) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_nsrc(nsrc); + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoSetNChan(BFheaderinfo obj, + int nchan) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_nchan(nchan); + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoSetChan0(BFheaderinfo obj, + int chan0) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_chan0(chan0); + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoSetTuning(BFheaderinfo obj, + int tuning) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_tuning(tuning); + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoSetGain(BFheaderinfo obj, + unsigned short int gain) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_gain(gain); + return BF_STATUS_SUCCESS; +} + +BFstatus bfHeaderInfoSetDecimation(BFheaderinfo obj, + unsigned int decimation) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + obj->set_decimation(decimation); + return BF_STATUS_SUCCESS; +} + +BFstatus bfDiskWriterCreate(BFpacketwriter* obj, + const char* format, + int fd, + int core) { + return BFpacketwriter_create(obj, format, fd, core, BF_IO_DISK); +} + +BFstatus bfUdpTransmitCreate(BFpacketwriter* obj, + const char* format, + int fd, + int core) { + return BFpacketwriter_create(obj, format, fd, core, BF_IO_UDP); +} + +BFstatus bfUdpVerbsTransmitCreate(BFpacketwriter* obj, + const char* format, + int fd, + int core) { + return BFpacketwriter_create(obj, format, fd, core, BF_IO_VERBS); +} + +BFstatus bfPacketWriterDestroy(BFpacketwriter obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + delete obj; + return BF_STATUS_SUCCESS; +} + +BFstatus bfPacketWriterSetRateLimit(BFpacketwriter obj, + uint32_t rate_limit) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(obj->set_rate_limit(rate_limit)); +} + +BFstatus bfPacketWriterResetRateLimitCounter(BFpacketwriter obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(obj->reset_rate_limit_counter()); +} + +BFstatus bfPacketWriterResetCounter(BFpacketwriter obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(obj->reset_counter()); +} + +BFstatus bfPacketWriterSend(BFpacketwriter obj, + BFheaderinfo info, + BFoffset seq, + BFoffset seq_increment, + BFoffset src, + BFoffset src_increment, + BFarray const* in) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + return obj->send(info, seq, seq_increment, src, src_increment, in); +} diff --git a/src/packet_writer.hpp b/src/packet_writer.hpp new file mode 100644 index 000000000..e5cd41c92 --- /dev/null +++ b/src/packet_writer.hpp @@ -0,0 +1,675 @@ +/* + * Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "assert.hpp" +#include +#include +#include "proclog.hpp" +#include "Socket.hpp" +#include "formats/formats.hpp" +#include "utils.hpp" +#include "hw_locality.hpp" + +#include // For ntohs +#include // For recvfrom + +#include +#include +#include +#include // For posix_memalign +#include // For memcpy, memset +#include + +#include +#include +#include +#include +#include +#include + +#ifndef BF_SEND_NPKTBURST +#define BF_SEND_NPKTBURST 16 +#endif + +class RateLimiter { + uint32_t _rate; + uint64_t _counter; + bool _first; + std::chrono::high_resolution_clock::time_point _start; + std::chrono::high_resolution_clock::time_point _stop; +public: + RateLimiter(uint32_t rate_limit=0) + : _rate(rate_limit), _counter(0), _first(true) {} + inline void set_rate(uint32_t rate_limit) { _rate = rate_limit; } + inline uint32_t get_rate() { return _rate; } + inline void reset_counter() { _first = true; _counter = 0; } + inline void begin() { + if( _first ) { + _start = std::chrono::high_resolution_clock::now(); + _first = false; + } + } + inline void end_and_wait(size_t npackets) { + if( _rate > 0 ) { + _stop = std::chrono::high_resolution_clock::now(); + _counter += std::max((size_t) 0, npackets); + double elapsed_needed = (double) _counter / _rate; + std::chrono::duration elapsed_actual = std::chrono::duration_cast>(_stop-_start); + + double sleep_needed = elapsed_needed - elapsed_actual.count(); + if( sleep_needed > 0.001 ) { + timespec sleep; + sleep.tv_sec = (int) sleep_needed; + sleep.tv_nsec = (int) ((sleep_needed - sleep.tv_sec)*1e9); + nanosleep(&sleep, NULL); + } + } + } +}; + +class PacketWriterMethod: public BoundThread { +protected: + int _fd; + size_t _max_burst_size; + RateLimiter _limiter; + int _core; +public: + PacketWriterMethod(int fd, size_t max_burst_size=BF_SEND_NPKTBURST, int core=-1) + : BoundThread(core), _fd(fd), _max_burst_size(max_burst_size), _limiter(0), _core(core) {} + virtual ssize_t send_packets(char* hdrs, + int hdr_size, + char* data, + int data_size, + int npackets, + int flags=0) { + return 0; + } + virtual const char* get_name() { return "generic_writer"; } + inline void set_rate(uint32_t rate_limit) { _limiter.set_rate(rate_limit); } + inline uint32_t get_rate() { return _limiter.get_rate(); } + inline void reset_counter() { _limiter.reset_counter(); } +}; + +class DiskPacketWriter : public PacketWriterMethod { +public: + DiskPacketWriter(int fd, size_t max_burst_size=BF_SEND_NPKTBURST, int core=-1) + : PacketWriterMethod(fd, max_burst_size, core) {} + ssize_t send_packets(char* hdrs, + int hdr_size, + char* data, + int data_size, + int npackets, + int flags=0) { + int i = 0; + ssize_t status, nsend, nsent = 0; + while(npackets > 0) { + _limiter.begin(); + if( _max_burst_size > 0 ) { + nsend = std::min(_max_burst_size, (size_t) npackets); + } else { + nsend = npackets; + } + for(int j=0; j _last_count ) { + if( _mmsg ) { + ::munlock(_mmsg, sizeof(struct mmsghdr)*_last_count); + free(_mmsg); + } + if( _iovs ) { + ::munlock(_iovs, sizeof(struct iovec)*2*_last_count); + free(_iovs); + } + + _last_count = npackets; + _mmsg = (struct mmsghdr *) malloc(sizeof(struct mmsghdr)*npackets); + _iovs = (struct iovec *) malloc(sizeof(struct iovec)*2*npackets); + ::mlock(_mmsg, sizeof(struct mmsghdr)*npackets); + ::mlock(_iovs, sizeof(struct iovec)*2*npackets); + + ::memset(_mmsg, 0, sizeof(struct mmsghdr)*npackets); + + for(int i=0; i 0) { + _limiter.begin(); + if( _max_burst_size > 0 ) { + nsend = std::min(_max_burst_size, (size_t) npackets); + } else { + nsend = npackets; + } + nsent_batch = ::sendmmsg(_fd, _mmsg+i, nsend, flags); + if( nsent_batch > 0 ) { + nsent += nsent_batch; + } + /* + if( nsent_batch == -1 ) { + std::cout << "sendmmsg failed: " << std::strerror(errno) << " with " << hdr_size << " and " << data_size << std::endl; + } + */ + i += nsend; + npackets -= nsend; + _limiter.end_and_wait(nsend); + } + + return nsent; + } + inline const char* get_name() { return "udp_transmit"; } +}; + +#if defined BF_VERBS_ENABLED && BF_VERBS_ENABLED +#include "ib_verbs_send.hpp" + +class UDPVerbsSender : public PacketWriterMethod { + VerbsSend _ibv; + bf_comb_udp_hdr _udp_hdr; + int _last_size; + int _last_count; + mmsghdr* _mmsg; + iovec* _iovs; +public: + UDPVerbsSender(int fd, size_t max_burst_size=BF_VERBS_SEND_NPKTBURST, int core=-1) + : PacketWriterMethod(fd, max_burst_size, core), _ibv(fd, JUMBO_FRAME_SIZE), _last_size(0), + _last_count(0), _mmsg(NULL), _iovs(NULL) {} + ~UDPVerbsSender() { + if( _mmsg ) { + free(_mmsg); + } + if( _iovs ) { + free(_iovs); + } + } + ssize_t send_packets(char* hdrs, + int hdr_size, + char* data, + int data_size, + int npackets, + int flags=0) { + if( npackets > _last_count ) { + if( _mmsg ) { + ::munlock(_mmsg, sizeof(struct mmsghdr)*_last_count); + free(_mmsg); + } + if( _iovs ) { + ::munlock(_iovs, sizeof(struct iovec)*3*_last_count); + free(_iovs); + } + + _last_count = npackets; + _mmsg = (struct mmsghdr *) malloc(sizeof(struct mmsghdr)*npackets); + _iovs = (struct iovec *) malloc(sizeof(struct iovec)*3*npackets); + ::mlock(_mmsg, sizeof(struct mmsghdr)*npackets); + ::mlock(_iovs, sizeof(struct iovec)*3*npackets); + + ::memset(_mmsg, 0, sizeof(struct mmsghdr)*npackets); + + for(int i=0; i 0 ) { + _ibv.set_rate_limit(_limiter.get_rate()*_last_size, _last_size, _max_burst_size); + } + } + + for(int i=0; ireset_stats(); + } + inline void set_rate_limit(uint32_t rate_limit) { _method->set_rate(rate_limit); } + inline uint32_t get_rate_limit() { return _method->get_rate(); } + inline void reset_rate_limit_counter() { _method->reset_counter(); } + inline ssize_t send(char* hdrs, + int hdr_size, + char* datas, + int data_size, + int npackets) { + ssize_t nsent = _method->send_packets(hdrs, hdr_size, datas, data_size, npackets); + if( nsent == -1 ) { + _stats.ninvalid += npackets; + _stats.ninvalid_bytes += npackets * (hdr_size + data_size); + } else { + _stats.nvalid += nsent; + _stats.nvalid_bytes += nsent * (hdr_size + data_size); + _stats.ninvalid += (npackets - nsent); + _stats.ninvalid_bytes += (npackets - nsent) * (hdr_size + data_size); + } + return nsent; + } + inline const char* get_name() { return _method->get_name(); } + inline const int get_core() { return _core; } + inline const PacketStats* get_stats() const { return &_stats; } + inline void reset_stats() { + ::memset(&_stats, 0, sizeof(_stats)); + } +}; + +class BFheaderinfo_impl { + PacketDesc _desc; +public: + inline BFheaderinfo_impl() { + ::memset(&_desc, 0, sizeof(PacketDesc)); + } + inline PacketDesc* get_description() { return &_desc; } + inline void set_nsrc(int nsrc) { _desc.nsrc = nsrc; } + inline void set_nchan(int nchan) { _desc.nchan = nchan; } + inline void set_chan0(int chan0) { _desc.chan0 = chan0; } + inline void set_tuning(int tuning) { _desc.tuning = tuning; } + inline void set_gain(uint16_t gain) { _desc.gain = gain; } + inline void set_decimation(uint32_t decimation) { _desc.decimation = decimation; } +}; + +class BFpacketwriter_impl { +protected: + std::string _name; + PacketWriterThread* _writer; + PacketHeaderFiller* _filler; + int _nsamples; + BFdtype _dtype; + + ProcLog _bind_log; + ProcLog _stat_log; + pid_t _pid; + + char* _pkt_hdrs; + int _last_size; + int _last_count; + BFoffset _framecount; +private: + void update_stats_log() { + const PacketStats* stats = _writer->get_stats(); + _stat_log.update() << "ngood_bytes : " << stats->nvalid_bytes << "\n" + << "nmissing_bytes : " << stats->ninvalid_bytes << "\n" + << "ninvalid : " << stats->ninvalid << "\n" + << "ninvalid_bytes : " << stats->ninvalid_bytes << "\n" + << "nlate : " << stats->nlate << "\n" + << "nlate_bytes : " << stats->nlate_bytes << "\n" + << "nvalid : " << stats->nvalid << "\n" + << "nvalid_bytes : " << stats->nvalid_bytes << "\n"; + } +public: + inline BFpacketwriter_impl(PacketWriterThread* writer, + PacketHeaderFiller* filler, + int nsamples, + BFdtype dtype) + : _name(writer->get_name()), _writer(writer), _filler(filler), + _nsamples(nsamples), _dtype(dtype), + _bind_log(_name+"/bind"), + _stat_log(_name+"/stats"), + _pkt_hdrs(NULL), _last_size(0), _last_count(0), + _framecount(0) { + _bind_log.update() << "ncore : " << 1 << "\n" + << "core0 : " << _writer->get_core() << "\n"; + } + inline ~BFpacketwriter_impl() { + if(_pkt_hdrs) { + free(_pkt_hdrs); + } + } + inline void set_rate_limit(uint32_t rate_limit) { _writer->set_rate_limit(rate_limit); } + inline void reset_rate_limit_counter() { _writer->reset_rate_limit_counter(); } + inline void reset_counter() { _framecount = 0; } + BFstatus send(BFheaderinfo info, + BFoffset seq, + BFoffset seq_increment, + BFoffset src, + BFoffset src_increment, + BFarray const* in); +}; + +class BFpacketwriter_generic_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_generic_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_U8), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new PacketHeaderFiller(); + _type_log.update("type : %s\n", "generic"); + } +}; + +class BFpacketwriter_simple_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_simple_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CI16), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new SIMPLEHeaderFiller(); + _type_log.update("type : %s\n", "simple"); + } +}; + +class BFpacketwriter_chips_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_chips_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CI4), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new CHIPSHeaderFiller(); + _type_log.update("type : %s\n", "chips"); + } +}; + +template +class BFpacketwriter_ibeam_impl : public BFpacketwriter_impl { + uint8_t _nbeam = B; + ProcLog _type_log; +public: + inline BFpacketwriter_ibeam_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CF32), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new IBeamHeaderFiller(); + _type_log.update("type : %s%i\n", "ibeam", _nbeam); + } +}; + +template +class BFpacketwriter_pbeam_impl : public BFpacketwriter_impl { + uint8_t _nbeam = B; + ProcLog _type_log; +public: + inline BFpacketwriter_pbeam_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_F32), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new PBeamHeaderFiller(); + _type_log.update("type : %s%i\n", "pbeam", _nbeam); + } +}; + +class BFpacketwriter_cor_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_cor_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CF32), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new CORHeaderFiller(); + _type_log.update("type : %s\n", "cor"); + } +}; + +class BFpacketwriter_tbn_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_tbn_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CI8), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new TBNHeaderFiller(); + _type_log.update("type : %s\n", "tbn"); + } +}; + +class BFpacketwriter_drx_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_drx_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CI4), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new DRXHeaderFiller(); + _type_log.update("type : %s\n", "drx"); + } +}; + +class BFpacketwriter_drx8_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_drx8_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CI8), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new DRX8HeaderFiller(); + _type_log.update("type : %s\n", "drx8"); + } +}; + +class BFpacketwriter_tbf_impl : public BFpacketwriter_impl { + int16_t _nstand; + ProcLog _type_log; +public: + inline BFpacketwriter_tbf_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CI4), + _nstand(0), _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new TBFHeaderFiller(); + _nstand = nsamples / 2 / 12; + _type_log.update("type : %s%i\n", "tbf", _nstand); + } +}; + +class BFpacketwriter_vbeam_impl : public BFpacketwriter_impl { + ProcLog _type_log; +public: + inline BFpacketwriter_vbeam_impl(PacketWriterThread* writer, + int nsamples) + : BFpacketwriter_impl(writer, nullptr, nsamples, BF_DTYPE_CF32), + _type_log((std::string(writer->get_name())+"/type").c_str()) { + _filler = new VBeamHeaderFiller(); + _type_log.update("type : %s\n", "tbf"); + } +}; + +BFstatus BFpacketwriter_create(BFpacketwriter* obj, + const char* format, + int fd, + int core, + BFiomethod backend) { + BF_ASSERT(obj, BF_STATUS_INVALID_POINTER); + + int nsamples = 0; + if(std::string(format).substr(0, 8) == std::string("generic_") ) { + nsamples = std::atoi((std::string(format).substr(8, std::string(format).length())).c_str()); + } else if( std::string(format).substr(0, 6) == std::string("simple") ) { + nsamples = 2048; + } else if( std::string(format).substr(0, 6) == std::string("chips_") ) { + int nchan = std::atoi((std::string(format).substr(6, std::string(format).length())).c_str()); + nsamples = 32*nchan; + } else if( std::string(format).substr(0, 5) == std::string("ibeam") ) { + int nbeam = std::stoi(std::string(format).substr(5, 1)); + int nchan = std::atoi((std::string(format).substr(7, std::string(format).length())).c_str()); + nsamples = 2*nbeam*nchan; + } else if( std::string(format).substr(0, 5) == std::string("pbeam") ) { + int nchan = std::atoi((std::string(format).substr(7, std::string(format).length())).c_str()); + nsamples = 4*nchan; + } else if( std::string(format).substr(0, 4) == std::string("cor_") ) { + int nchan = std::atoi((std::string(format).substr(4, std::string(format).length())).c_str()); + nsamples = 4*nchan; + } else if( format == std::string("tbn") ) { + nsamples = 512; + } else if( format == std::string("drx") ) { + nsamples = 4096; + } else if( format == std::string("drx8") ) { + nsamples = 4096; + } else if( format == std::string("tbf") ) { + nsamples = 6144; + } else if( std::string(format).substr(0, 6) == std::string("vbeam_") ) { + // e.g. "vbeam_184" is a 184-channel voltage beam" + int nchan = std::atoi((std::string(format).substr(13, std::string(format).length())).c_str()); + nsamples = 2*nchan; // 2 polarizations. Natively 32-bit floating complex (see implementation class) + } + + PacketWriterMethod* method; + if( backend == BF_IO_DISK ) { + method = new DiskPacketWriter(fd, core=core); + } else if( backend == BF_IO_UDP ) { + method = new UDPPacketSender(fd, core=core); +#if defined BF_VERBS_ENABLED && BF_VERBS_ENABLED + } else if( backend == BF_IO_VERBS ) { + method = new UDPVerbsSender(fd, core=core); +#endif + } else { + return BF_STATUS_UNSUPPORTED; + } + PacketWriterThread* writer = new PacketWriterThread(method, core); + + if( std::string(format).substr(0, 8) == std::string("generic_") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_generic_impl(writer, nsamples), + *obj = 0); + } else if( std::string(format).substr(0, 6) == std::string("simple") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_simple_impl(writer, nsamples), + *obj = 0); + } else if( std::string(format).substr(0, 6) == std::string("chips_") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_chips_impl(writer, nsamples), + *obj = 0); +#define MATCH_IBEAM_MODE(NBEAM) \ + } else if( std::string(format).substr(0, 7) == std::string("ibeam"#NBEAM"_") ) { \ + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_ibeam_impl(writer, nsamples), \ + *obj = 0); + MATCH_IBEAM_MODE(1) + MATCH_IBEAM_MODE(2) + MATCH_IBEAM_MODE(3) + MATCH_IBEAM_MODE(4) +#undef MATCH_IBEAM_MODE +#define MATCH_PBEAM_MODE(NBEAM) \ + } else if( std::string(format).substr(0, 7) == std::string("pbeam"#NBEAM"_") ) { \ + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_pbeam_impl(writer, nsamples), \ + *obj = 0); + MATCH_PBEAM_MODE(1) +#undef MATCH_PBEAM_MODE + } else if( std::string(format).substr(0, 4) == std::string("cor_") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_cor_impl(writer, nsamples), + *obj = 0); + } else if( format == std::string("tbn") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_tbn_impl(writer, nsamples), + *obj = 0); + } else if( format == std::string("drx") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_drx_impl(writer, nsamples), + *obj = 0); + } else if( format == std::string("drx8") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_drx8_impl(writer, nsamples), + *obj = 0); + } else if( std::string(format).substr(0, 3) == std::string("tbf") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_tbf_impl(writer, nsamples), + *obj = 0); + } else if( std::string(format).substr(0, 6) == std::string("vbeam_") ) { + BF_TRY_RETURN_ELSE(*obj = new BFpacketwriter_vbeam_impl(writer, nsamples), + *obj = 0); + } else { + return BF_STATUS_UNSUPPORTED; + } +} diff --git a/src/proclog.cpp b/src/proclog.cpp index e0380dfe7..94159686b 100644 --- a/src/proclog.cpp +++ b/src/proclog.cpp @@ -26,15 +26,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include "trace.hpp" #include "proclog.hpp" +#include "fileutils.hpp" #include #include // For system #include // For va_start, va_list, va_end -#include // For flock -#include // For fstat #include // For getpid #include // For opendir, readdir, closedir #include // For getpid @@ -42,66 +42,8 @@ #include #include -void make_dir(std::string path, int perms=775) { - if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { - throw std::runtime_error("Failed to create path: "+path); - } -} -void remove_all(std::string path) { - if( std::system(("rm -rf "+path).c_str()) ) { - throw std::runtime_error("Failed to remove all: "+path); - } -} -void remove_dir(std::string path) { - if( std::system(("rmdir "+path+" 2> /dev/null").c_str()) ) { - throw std::runtime_error("Failed to remove dir: "+path); - } -} -void remove_file(std::string path) { - if( std::system(("rm -f "+path).c_str()) ) { - throw std::runtime_error("Failed to remove file: "+path); - } -} -bool process_exists(pid_t pid) { - struct stat s; - return !(stat(("/proc/"+std::to_string(pid)).c_str(), &s) == -1 - && errno == ENOENT); -} - -std::string get_dirname(std::string filename) { - // TODO: This is crude, but works for our proclog use-case - return filename.substr(0, filename.find_last_of("/")); -} - -class LockFile { - std::string _lockfile; - int _fd; -public: - LockFile(LockFile const& ) = delete; - LockFile& operator=(LockFile const& ) = delete; - LockFile(std::string lockfile) : _lockfile(lockfile) { - while( true ) { - _fd = open(_lockfile.c_str(), O_CREAT, 600); - flock(_fd, LOCK_EX); - struct stat fd_stat, lockfile_stat; - fstat(_fd, &fd_stat); - stat(_lockfile.c_str(), &lockfile_stat); - // Compare inodes - if( fd_stat.st_ino == lockfile_stat.st_ino ) { - // Got the lock - break; - } - close(_fd); - } - } - ~LockFile() { - unlink(_lockfile.c_str()); - flock(_fd, LOCK_UN); - } -}; - class ProcLogMgr { - static constexpr const char* base_logdir = "/dev/shm/bifrost"; + static constexpr const char* base_logdir = BF_PROCLOG_DIR; std::string _logdir; std::set _logs; std::set _created_dirs; @@ -117,8 +59,8 @@ class ProcLogMgr { pid_t pid = atoi(ep->d_name); if( pid && !process_exists(pid) ) { try { - remove_all(std::string(base_logdir) + "/" + - std::to_string(pid)); + remove_files_recursively(std::string(base_logdir) + "/" + + std::to_string(pid)); } catch( std::exception& ) {} } } @@ -131,12 +73,12 @@ class ProcLogMgr { ProcLogMgr() : _logdir(std::string(base_logdir) + "/" + std::to_string(getpid())) { this->try_base_logdir_cleanup(); - make_dir(base_logdir, 777); + make_dir(base_logdir, 0777); make_dir(_logdir); } ~ProcLogMgr() { try { - remove_all(_logdir); + remove_files_recursively(_logdir); this->try_base_logdir_cleanup(); } catch( std::exception& ) {} } diff --git a/src/quantize.cpp b/src/quantize.cpp index ebdfede9f..f73ef6390 100644 --- a/src/quantize.cpp +++ b/src/quantize.cpp @@ -34,7 +34,7 @@ #include -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED #include "cuda.hpp" #include "trace.hpp" #include @@ -251,7 +251,7 @@ BFstatus bfQuantize(BFarray const* in, BF_ASSERT(is_contiguous(in), BF_STATUS_UNSUPPORTED_STRIDE); BF_ASSERT(is_contiguous(out), BF_STATUS_UNSUPPORTED_STRIDE); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED BF_ASSERT(space_accessible_from(in->space, BF_SPACE_SYSTEM) || (space_accessible_from(in->space, BF_SPACE_CUDA) && space_accessible_from(out->space, BF_SPACE_CUDA)), BF_STATUS_UNSUPPORTED_SPACE); BF_ASSERT(space_accessible_from(out->space, BF_SPACE_SYSTEM) || (space_accessible_from(in->space, BF_SPACE_CUDA) && space_accessible_from(out->space, BF_SPACE_CUDA)), @@ -267,7 +267,7 @@ BFstatus bfQuantize(BFarray const* in, bool byteswap_in = ( in->big_endian != is_big_endian()); bool byteswap_out = (out->big_endian != is_big_endian()); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { BF_ASSERT(nelement<=(size_t)512*65535*65535, BF_STATUS_UNSUPPORTED_SHAPE); } @@ -280,7 +280,7 @@ BFstatus bfQuantize(BFarray const* in, QuantizeFunctor \ (scale,byteswap_in,byteswap_out)) -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED #define CALL_FOREACH_SIMPLE_GPU_QUANTIZE(itype,stype,otype) \ { \ BF_TRACE(); \ @@ -301,7 +301,7 @@ BFstatus bfQuantize(BFarray const* in, case BF_DTYPE_CI1: nelement *= 2; case BF_DTYPE_I1: { BF_ASSERT(nelement % 8 == 0, BF_STATUS_INVALID_SHAPE); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { BF_TRACE(); BF_TRACE_STREAM(g_cuda_stream); @@ -330,7 +330,7 @@ BFstatus bfQuantize(BFarray const* in, case BF_DTYPE_CI2: nelement *= 2; case BF_DTYPE_I2: { BF_ASSERT(nelement % 4 == 0, BF_STATUS_INVALID_SHAPE); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { BF_TRACE(); BF_TRACE_STREAM(g_cuda_stream); @@ -359,7 +359,7 @@ BFstatus bfQuantize(BFarray const* in, case BF_DTYPE_CI4: nelement *= 2; case BF_DTYPE_I4: { BF_ASSERT(nelement % 2 == 0, BF_STATUS_INVALID_SHAPE); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { BF_TRACE(); BF_TRACE_STREAM(g_cuda_stream); @@ -387,7 +387,7 @@ BFstatus bfQuantize(BFarray const* in, } case BF_DTYPE_CI8: nelement *= 2; case BF_DTYPE_I8: { -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_QUANTIZE(float,float,int8_t); } else { @@ -400,7 +400,7 @@ BFstatus bfQuantize(BFarray const* in, } case BF_DTYPE_CI16: nelement *= 2; case BF_DTYPE_I16: { -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_QUANTIZE(float,float,int16_t); } else { @@ -413,7 +413,7 @@ BFstatus bfQuantize(BFarray const* in, } case BF_DTYPE_CI32: nelement *= 2; case BF_DTYPE_I32: { -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_QUANTIZE(float,double,int32_t); } else { @@ -425,7 +425,7 @@ BFstatus bfQuantize(BFarray const* in, break; } case BF_DTYPE_U8: { -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { } else { @@ -437,7 +437,7 @@ BFstatus bfQuantize(BFarray const* in, break; } case BF_DTYPE_U16: { -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_QUANTIZE(float,float,uint16_t); } else { @@ -449,7 +449,7 @@ BFstatus bfQuantize(BFarray const* in, break; } case BF_DTYPE_U32: { -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_QUANTIZE(float,double,uint32_t); } else { diff --git a/src/rdma.cpp b/src/rdma.cpp new file mode 100644 index 000000000..102c693ae --- /dev/null +++ b/src/rdma.cpp @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2022, The Bifrost Authors. All rights reserved. + * Copyright (c) 2022, The University of New Mexico. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "rdma.hpp" +#include "utils.hpp" + +ssize_t BFrdma_impl::send_header(BFoffset time_tag, + BFsize header_size, + const void* header, + BFoffset offset_from_head) { + BF_ASSERT(header_size <= this->max_message_size(), BF_STATUS_INVALID_SHAPE); + + bf_message msg; + msg.type = bf_message::MSG_HEADER; + msg.time_tag = time_tag; + msg.length = header_size; + msg.offset = offset_from_head; + + return _rdma->send(&msg, header); +} + +ssize_t BFrdma_impl::send_span(BFarray const* span) { + size_t span_size = BF_DTYPE_NBYTE(span->dtype); + for(int i=0; indim; i++) { + span_size *= span->shape[i]; + } + BF_ASSERT(span_size <= this->max_message_size(), BF_STATUS_INVALID_SHAPE); + + bf_message msg; + msg.type = bf_message::MSG_SPAN; + msg.time_tag = 0; + msg.length = span_size; + msg.offset = 0; + + return _rdma->send(&msg, span->data); +} + +ssize_t BFrdma_impl::receive(BFoffset* time_tag, + BFsize* header_size, + BFoffset* offset_from_head, + BFsize* span_size, + void* contents) { + bf_message msg; + ::memset(&msg, 0, sizeof(bf_message)); + ssize_t nrecv; + nrecv = _rdma->receive(&msg, contents); + if( msg.type == bf_message::MSG_HEADER) { + *time_tag = msg.time_tag; + *header_size = msg.length; + *offset_from_head = msg.offset; + *span_size = 0; + } else { + *time_tag = 0; + *header_size = 0; + *offset_from_head = 0; + *span_size = msg.length; + + } + + return nrecv; +} + +BFstatus bfRdmaCreate(BFrdma* obj, + int fd, + size_t message_size, + int is_server) { + BF_ASSERT(message_size <= BF_RDMA_MAXMEM, BF_STATUS_INSUFFICIENT_STORAGE); + BF_TRY_RETURN_ELSE(*obj = new BFrdma_impl(fd, message_size, is_server), + *obj = 0); +} + +BFstatus bfRdmaDestroy(BFrdma obj) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + delete obj; + return BF_STATUS_SUCCESS; +} + +BFstatus bfRdmaSendHeader(BFrdma obj, + BFoffset time_tag, + BFsize header_size, + const void* header, + BFoffset offset_from_head) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_ASSERT(header, BF_STATUS_INVALID_POINTER); + ssize_t nsent; + nsent = obj->send_header(time_tag, header_size, header, offset_from_head); + if( nsent < 0 ) { + return BF_STATUS_INTERNAL_ERROR; + } + return BF_STATUS_SUCCESS; +} + +BFstatus bfRdmaSendSpan(BFrdma obj, + BFarray const* span) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_ASSERT(span, BF_STATUS_INVALID_POINTER); + ssize_t nsent; + nsent = obj->send_span(span); + if( nsent < 0 ) { + return BF_STATUS_INTERNAL_ERROR; + } + return BF_STATUS_SUCCESS; +} + +BFstatus bfRdmaReceive(BFrdma obj, + BFoffset* time_tag, + BFsize* header_size, + BFoffset* offset_from_head, + BFsize* span_size, + void* contents) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + ssize_t nrecv; + nrecv = obj->receive(time_tag, header_size, offset_from_head, span_size, contents); + if( nrecv < 0 ) { + return BF_STATUS_INTERNAL_ERROR; + } + return BF_STATUS_SUCCESS; +} diff --git a/src/rdma.hpp b/src/rdma.hpp new file mode 100644 index 000000000..9c2819ca3 --- /dev/null +++ b/src/rdma.hpp @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2022, The Bifrost Authors. All rights reserved. + * Copyright (c) 2022, The University of New Mexico. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "assert.hpp" +#include +#include + +#include // For ntohs +#include // For mlock + +#include +#include +#include +#include +#include // For posix_memalign +#include // For memcpy, memset + +#include +#include + +struct __attribute__((aligned(8))) bf_message { + enum { + MSG_HEADER = 0, + MSG_SPAN = 1, + MSG_REPLY = 2, + } type; + uint64_t time_tag; + uint64_t offset; + uint64_t length; +}; + +struct bf_rdma { + struct rdma_cm_id* listen_id; + struct rdma_cm_id* id; + + struct rdma_addrinfo* res; + struct ibv_wc wc; + + size_t buf_size; + uint8_t* buf; + uint8_t* send_buf; + struct ibv_mr* mr; + struct ibv_mr* send_mr; +}; + +class Rdma { + int _fd; + size_t _message_size; + bool _is_server; + bf_rdma _rdma; + + void get_ip_address(char* ip) { + sockaddr_in sin; + socklen_t len = sizeof(sin); + if( _is_server ) { + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + } else { + check_error(::getpeername(_fd, (sockaddr *)&sin, &len), + "query peer name"); + } + inet_ntop(AF_INET, &(sin.sin_addr), ip, INET_ADDRSTRLEN); + } + uint16_t get_port() { + sockaddr_in sin; + socklen_t len = sizeof(sin); + if( _is_server ) { + check_error(::getsockname(_fd, (sockaddr *)&sin, &len), + "query socket name"); + } else { + check_error(::getpeername(_fd, (sockaddr *)&sin, &len), + "query peer name"); + } + return ntohs(sin.sin_port); + } + void create_connection(size_t message_size) { + struct rdma_addrinfo hints; + struct ibv_qp_init_attr init_attr; + struct ibv_qp_attr qp_attr; + + char server[INET_ADDRSTRLEN]; + char port[7]; + this->get_ip_address(&(server[0])); + snprintf(&(port[0]), 7, "%d", this->get_port()); + + ::memset(&hints, 0, sizeof(hints)); + if( _is_server ) { + hints.ai_flags = RAI_PASSIVE; + } + hints.ai_port_space = RDMA_PS_TCP; + check_error(rdma_getaddrinfo(&(server[0]), &(port[0]), &hints, &(_rdma.res)), + "query RDMA address information"); + + ::memset(&init_attr, 0, sizeof(init_attr)); + init_attr.cap.max_send_wr = init_attr.cap.max_recv_wr = 1; + init_attr.cap.max_send_sge = init_attr.cap.max_recv_sge = 1; + init_attr.cap.max_inline_data = 0; + if( !_is_server ) { + init_attr.qp_context = _rdma.id; + } + init_attr.sq_sig_all = 1; + + if( _is_server ) { + check_error(rdma_create_ep(&(_rdma.listen_id), _rdma.res, NULL, &init_attr), + "create the RDMA identifier"); + + check_error(rdma_listen(_rdma.listen_id, 0), + "listen for incoming connections"); + + check_error(rdma_get_request(_rdma.listen_id, &(_rdma.id)), + "get connection request"); + + ::memset(&qp_attr, 0, sizeof(qp_attr)); + ::memset(&init_attr, 0, sizeof(init_attr)); + check_error(ibv_query_qp(_rdma.id->qp, &qp_attr, IBV_QP_CAP, &init_attr), + "query the queue pair"); + } else { + check_error(rdma_create_ep(&(_rdma.id), _rdma.res, NULL, &init_attr), + "create the RDMA identifier"); + } + + _rdma.buf_size = message_size + sizeof(bf_message); + check_error(::posix_memalign((void**)&(_rdma.buf), 32, _rdma.buf_size), + "allocate buffer"); + check_error(::mlock(_rdma.buf, _rdma.buf_size), + "lock buffer"); + _rdma.mr = rdma_reg_msgs(_rdma.id, _rdma.buf, _rdma.buf_size); + check_null(_rdma.mr, "create memory region"); + + check_error(::posix_memalign((void**)&(_rdma.send_buf), 32, _rdma.buf_size), + "allocate send buffer"); + check_error(::mlock(_rdma.send_buf, _rdma.buf_size), + "lock send buffer"); + _rdma.send_mr = rdma_reg_msgs(_rdma.id, _rdma.send_buf, _rdma.buf_size); + check_null(_rdma.send_mr, "create send memory region"); + + if( _is_server ) { + check_error(rdma_accept(_rdma.id, NULL), + "accept incomining connections"); + } else { + check_error(rdma_connect(_rdma.id, NULL), + "connect"); + + check_error(rdma_post_recv(_rdma.id, NULL, _rdma.buf, _rdma.buf_size, _rdma.mr), + "set RDMA post receive"); + } + } + inline void close_connection() { + if( _rdma.id ) { + rdma_disconnect(_rdma.id); + } + + if( _rdma.mr ) { + rdma_dereg_mr(_rdma.mr); + } + + if( _rdma.send_mr ) { + rdma_dereg_mr(_rdma.send_mr); + } + + if( _rdma.buf ) { + ::munlock(_rdma.buf, _rdma.buf_size); + ::free(_rdma.buf); + } + + if( _rdma.send_buf ) { + ::munlock(_rdma.send_buf, _rdma.buf_size); + ::free(_rdma.send_buf); + } + + if( _rdma.id ) { + rdma_destroy_ep(_rdma.id); + } + + if( _rdma.listen_id ) { + rdma_destroy_ep(_rdma.listen_id); + } + + if( _rdma.res ) { + rdma_freeaddrinfo(_rdma.res); + } + } + inline void check_error(int retval, std::string what) { + if( retval < 0 ) { + close_connection(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + throw Rdma::Error(ss.str()); + } + } + inline void check_null(void* ptr, std::string what) { + if( ptr == NULL ) { + close_connection(); + + std::stringstream ss; + ss << "Failed to " << what << ": (" << errno << ") " + << strerror(errno); + throw Rdma::Error(ss.str()); + } + } +public: + class Error : public std::runtime_error { + typedef std::runtime_error super_t; + protected: + virtual const char* what() const throw() { + return super_t::what(); + } + public: + Error(const std::string& what_arg) + : super_t(what_arg) {} + }; + + Rdma(int fd, size_t message_size, bool is_server) + : _fd(fd), _message_size(message_size), _is_server(is_server) { + ::memset(&_rdma, 0, sizeof(_rdma)); + create_connection(message_size); + } + ~Rdma() { + close_connection(); + } + inline size_t max_message_size() { return _message_size; } + inline ssize_t send(const bf_message* msg, const void* buf) { + ::memcpy(_rdma.send_buf, msg, sizeof(bf_message)); + ::memcpy(_rdma.send_buf+sizeof(bf_message), buf, msg->length); + + check_error(rdma_post_send(_rdma.id, NULL, _rdma.send_buf, _rdma.buf_size, _rdma.send_mr, 0), + "queue send request"); + check_error(rdma_get_send_comp(_rdma.id, &(_rdma.wc)), + "get send completion"); + + bf_message *reply; + check_error(rdma_post_recv(_rdma.id, NULL, _rdma.buf, sizeof(bf_message), _rdma.mr), + "queue receive request"); + check_error(rdma_get_recv_comp(_rdma.id, &(_rdma.wc)), + "get receive completion"); + + reply = reinterpret_cast(_rdma.buf); + if( reply->type != bf_message::MSG_REPLY ) { + return -1; + } + return msg->length; + } + inline ssize_t receive(bf_message* msg, void* buf) { + check_error(rdma_get_recv_comp(_rdma.id, &(_rdma.wc)), + "get receive completion"); + + ::memcpy(msg, _rdma.buf, sizeof(bf_message)); + ::memcpy(buf, _rdma.buf+sizeof(bf_message), msg->length); + + bf_message* reply; + reply = reinterpret_cast(_rdma.send_buf); + reply->type = bf_message::MSG_REPLY; + check_error(rdma_post_send(_rdma.id, NULL, _rdma.send_buf, sizeof(bf_message), _rdma.send_mr, 0), + "queue send request"); + check_error(rdma_get_send_comp(_rdma.id, &(_rdma.wc)), + "get send completion"); + check_error(rdma_post_recv(_rdma.id, NULL, _rdma.buf, _rdma.buf_size, _rdma.mr), + "queue receive request"); + + return msg->length; + } +}; + +class BFrdma_impl { + Rdma* _rdma; + +public: + inline BFrdma_impl(int fd, size_t message_size, int is_server) { + _rdma = new Rdma(fd, message_size, is_server); + } + inline size_t max_message_size() { return _rdma->max_message_size(); } + ssize_t send_header(BFoffset time_tag, + BFsize header_size, + const void* header, + BFoffset offset_from_head); + ssize_t send_span(BFarray const* span); + ssize_t receive(BFoffset* time_tag, + BFsize* header_size, + BFoffset* offset_from_head, + BFsize* span_size, + void* contents); +}; diff --git a/src/reduce.cu b/src/reduce.cu index 363751e69..7fc03d983 100644 --- a/src/reduce.cu +++ b/src/reduce.cu @@ -243,6 +243,11 @@ void launch_reduce_loop_kernel(IType const* in, BF_STATUS_INTERNAL_ERROR); } +inline bool is_reduce_vector_aligned(BFarray const* in, + long reduce_size) { + return ((((uint64_t) in->data) / BF_DTYPE_NBYTE(in->dtype) % reduce_size) == 0); +} + template BFstatus reduce_itype_otype(BFarray const* in, BFarray const* out, @@ -290,23 +295,27 @@ BFstatus reduce_itype_otype(BFarray const* in, bool use_vec2_kernel = ( istride_reduce == 1 && reduce_size == 2 && - istrides.x % 2 == 0 && istrides.y % 2 == 0 && istrides.z % 2 == 0); + istrides.x % 2 == 0 && istrides.y % 2 == 0 && istrides.z % 2 == 0 && + is_reduce_vector_aligned(in, reduce_size)); //std::cout << istride_reduce << ", " << reduce_size << ", " << istrides.x << ", " << istrides.y << ", " << istrides.z << std::endl; bool use_vec4_kernel = ( istride_reduce == 1 && reduce_size == 4 && - istrides.x % 4 == 0 && istrides.y % 4 == 0 && istrides.z % 4 == 0); + istrides.x % 4 == 0 && istrides.y % 4 == 0 && istrides.z % 4 == 0 && + is_reduce_vector_aligned(in, reduce_size)); bool use_vec8_kernel = ( sizeof(IType) <= 2 && istride_reduce == 1 && reduce_size == 8 && - istrides.x % 8 == 0 && istrides.y % 8 == 0 && istrides.z % 8 == 0); + istrides.x % 8 == 0 && istrides.y % 8 == 0 && istrides.z % 8 == 0 && + is_reduce_vector_aligned(in, reduce_size)); bool use_vec16_kernel = ( sizeof(IType) == 1 && istride_reduce == 1 && reduce_size == 16 && - istrides.x % 16 == 0 && istrides.y % 16 == 0 && istrides.z % 16 == 0); - + istrides.x % 16 == 0 && istrides.y % 16 == 0 && istrides.z % 16 == 0 && + is_reduce_vector_aligned(in, reduce_size)); + if( use_vec2_kernel ) { BF_TRY_RETURN( launch_reduce_vector_kernel<2>((IType*)in->data, (OType*)out->data, @@ -553,17 +562,20 @@ BFstatus reduce_complex_standard_itype_otype(BFarray const* in, bool use_vec2_kernel = ( istride_reduce == 1 && reduce_size == 2 && - istrides.x % 2 == 0 && istrides.y % 2 == 0 && istrides.z % 2 == 0); + istrides.x % 2 == 0 && istrides.y % 2 == 0 && istrides.z % 2 == 0 && + is_reduce_vector_aligned(in, reduce_size)); //std::cout << istride_reduce << ", " << reduce_size << ", " << istrides.x << ", " << istrides.y << ", " << istrides.z << std::endl; bool use_vec4_kernel = ( istride_reduce == 1 && reduce_size == 4 && - istrides.x % 4 == 0 && istrides.y % 4 == 0 && istrides.z % 4 == 0); + istrides.x % 4 == 0 && istrides.y % 4 == 0 && istrides.z % 4 == 0 && + is_reduce_vector_aligned(in, reduce_size)); bool use_vec8_kernel = ( sizeof(IType) <= 2 && istride_reduce == 1 && reduce_size == 8 && - istrides.x % 8 == 0 && istrides.y % 8 == 0 && istrides.z % 8 == 0); + istrides.x % 8 == 0 && istrides.y % 8 == 0 && istrides.z % 8 == 0 && + is_reduce_vector_aligned(in, reduce_size)); if( use_vec2_kernel ) { BF_TRY_RETURN( @@ -796,17 +808,20 @@ BFstatus reduce_complex_power_itype_otype(BFarray const* in, bool use_vec2_kernel = ( istride_reduce == 1 && reduce_size == 2 && - istrides.x % 2 == 0 && istrides.y % 2 == 0 && istrides.z % 2 == 0); + istrides.x % 2 == 0 && istrides.y % 2 == 0 && istrides.z % 2 == 0 && + is_reduce_vector_aligned(in, reduce_size)); //std::cout << istride_reduce << ", " << reduce_size << ", " << istrides.x << ", " << istrides.y << ", " << istrides.z << std::endl; bool use_vec4_kernel = ( istride_reduce == 1 && reduce_size == 4 && - istrides.x % 4 == 0 && istrides.y % 4 == 0 && istrides.z % 4 == 0); + istrides.x % 4 == 0 && istrides.y % 4 == 0 && istrides.z % 4 == 0 && + is_reduce_vector_aligned(in, reduce_size)); bool use_vec8_kernel = ( sizeof(IType) <= 2 && istride_reduce == 1 && reduce_size == 8 && - istrides.x % 8 == 0 && istrides.y % 8 == 0 && istrides.z % 8 == 0); + istrides.x % 8 == 0 && istrides.y % 8 == 0 && istrides.z % 8 == 0 && + is_reduce_vector_aligned(in, reduce_size)); if( use_vec2_kernel ) { BF_TRY_RETURN( diff --git a/src/ring.cpp b/src/ring.cpp index ce0614b4a..0cf0f3d79 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,6 +29,7 @@ // TODO: Consider adding Add BF_TRY( ) to destructors too to ease debugging +#include #include #include "ring_impl.hpp" #include "assert.hpp" @@ -68,7 +69,7 @@ BFstatus bfRingGetSpace(BFring ring, BFspace* space) { BFstatus bfRingSetAffinity(BFring ring, int core) { BF_ASSERT(ring, BF_STATUS_INVALID_HANDLE); BF_ASSERT(core >= -1, BF_STATUS_INVALID_ARGUMENT); - BF_ASSERT(BF_NUMA_ENABLED, BF_STATUS_UNSUPPORTED); + BF_ASSERT(BF_HWLOC_ENABLED, BF_STATUS_UNSUPPORTED); BF_TRY_RETURN(ring->set_core(core)); } BFstatus bfRingGetAffinity(BFring ring, int* core) { diff --git a/src/ring_impl.cpp b/src/ring_impl.cpp index 57da516df..cc452ac24 100644 --- a/src/ring_impl.cpp +++ b/src/ring_impl.cpp @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. +/* + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,18 +45,16 @@ // Work out whether/how to support independent specification of // buffer_factor. +#include "hw_locality.hpp" #include "ring_impl.hpp" #include "utils.hpp" #include "assert.hpp" +#include #include #include #include "cuda.hpp" -#if BF_NUMA_ENABLED -#include -#endif - // This implements a lock with the condition that no reads or writes // can be open while it is held. class RingReallocLock { @@ -150,23 +148,22 @@ void BFring_impl::resize(BFsize contiguous_span, BFsize new_stride = new_span + new_ghost_span; BFsize new_nbyte = new_stride*new_nringlet; //pointer new_buf = (pointer)bfMalloc(new_nbyte, _space); - //std::cout << "new_buf = " << (void*)new_buf << std::endl; // HACK TESTING + //std::std::cout << "new_buf = " << (void*)new_buf << std::endl; // HACK TESTING pointer new_buf = nullptr; - //std::cout << "contig_span: " << contiguous_span << std::endl; - //std::cout << "total_span: " << total_span << std::endl; - //std::cout << "new_span: " << new_span << std::endl; - //std::cout << "new_ghost_span: " << new_ghost_span << std::endl; - //std::cout << "new_nringlet: " << new_nringlet << std::endl; - //std::cout << "new_stride: " << new_stride << std::endl; - //std::cout << "Allocating " << new_nbyte << std::endl; + //std::std::cout << "contig_span: " << contiguous_span << std::endl; + //std::std::cout << "total_span: " << total_span << std::endl; + //std::std::cout << "new_span: " << new_span << std::endl; + //std::std::cout << "new_ghost_span: " << new_ghost_span << std::endl; + //std::std::cout << "new_nringlet: " << new_nringlet << std::endl; + //std::std::cout << "new_stride: " << new_stride << std::endl; + //std::std::cout << "Allocating " << new_nbyte << std::endl; BF_ASSERT_EXCEPTION(bfMalloc((void**)&new_buf, new_nbyte, _space) == BF_STATUS_SUCCESS, BF_STATUS_MEM_ALLOC_FAILED); -#if BF_NUMA_ENABLED +#if BF_HWLOC_ENABLED if( _core != -1 ) { - BF_ASSERT_EXCEPTION(numa_available() != -1, BF_STATUS_UNSUPPORTED); - int node = numa_node_of_cpu(_core); + int node = _hwloc.get_numa_node_of_core(_core); BF_ASSERT_EXCEPTION(node != -1, BF_STATUS_INVALID_ARGUMENT); - numa_tonode_memory(new_buf, new_nbyte, node); + _hwloc.bind_memory_area_to_numa_node(new_buf, new_nbyte, node); } #endif if( _buf ) { @@ -478,7 +475,7 @@ void BFring_impl::finish_sequence(BFsequence_sptr sequence, void BFring_impl::_write_proclog_entry() { char cinfo[32]=""; - #if BF_NUMA_ENABLED + #if BF_HWLOC_ENABLED snprintf(cinfo, 31, "binding : %i\n", _core); #endif _size_log.update("space : %s\n" @@ -590,7 +587,7 @@ void BFring_impl::commit_span(BFoffset begin, BFsize reserve_size, BFsize commit // in which case they will block here until they are // in order (i.e., they will automatically synchronise). // This is useful for multithreading with OpenMP - //std::cout << "(1) begin, head, rhead: " << begin << ", " << _head << ", " << _reserve_head << std::endl; + //std::std::cout << "(1) begin, head, rhead: " << begin << ", " << _head << ", " << _reserve_head << std::endl; _write_close_condition.wait(lock, [&]() { return (begin == _head); }); @@ -605,7 +602,7 @@ void BFring_impl::commit_span(BFoffset begin, BFsize reserve_size, BFsize commit // There are reservations in front of this one, so we // are not allowed to commit less than size. // TODO: How to deal with error here? - //std::cout << "BFRING ERROR: Must commit whole wspan when other spans are reserved" << std::endl; + //std::std::cout << "BFRING ERROR: Must commit whole wspan when other spans are reserved" << std::endl; //return; BF_ASSERT_EXCEPTION(false, BF_STATUS_INVALID_STATE); } diff --git a/src/ring_impl.hpp b/src/ring_impl.hpp index 7a6f71a79..94c9e274a 100644 --- a/src/ring_impl.hpp +++ b/src/ring_impl.hpp @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. +/* + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,6 +32,7 @@ #include #include "assert.hpp" #include "proclog.hpp" +#include "hw_locality.hpp" #include #include @@ -43,10 +44,6 @@ #include #include -#ifndef BF_NUMA_ENABLED -#define BF_NUMA_ENABLED 0 -#endif - class BFsequence_impl; class BFspan_impl; class BFrspan_impl; @@ -100,8 +97,11 @@ class BFring_impl { BFsize _nwrite_open; BFsize _nrealloc_pending; - int _core; - ProcLog _size_log; +#if BF_HWLOC_ENABLED + HardwareLocality _hwloc; +#endif + int _core; + ProcLog _size_log; std::queue _sequence_queue; std::map _sequence_map; diff --git a/src/romein.cu b/src/romein.cu index 866bf869b..68d45575d 100644 --- a/src/romein.cu +++ b/src/romein.cu @@ -32,6 +32,7 @@ Implements the Romein convolutional algorithm onto a GPU using CUDA. */ #include +#include #include #include "romein_kernels.cuh" @@ -366,7 +367,7 @@ public: BF_TRACE(); BF_TRACE_STREAM(_stream); BF_ASSERT_EXCEPTION(kernels->dtype == BF_DTYPE_CF32 \ - || BF_DTYPE_CF64, BF_STATUS_UNSUPPORTED_DTYPE); + || kernels->dtype == BF_DTYPE_CF64, BF_STATUS_UNSUPPORTED_DTYPE); int nkernels = kernels->shape[0]; for(int i=1; indim-4; ++i) { @@ -385,7 +386,7 @@ public: BF_ASSERT_EXCEPTION(_z != NULL, BF_STATUS_INVALID_STATE); BF_ASSERT_EXCEPTION(_kernels != NULL, BF_STATUS_INVALID_STATE); BF_ASSERT_EXCEPTION(out->dtype == BF_DTYPE_CF32 \ - || BF_DTYPE_CF64, BF_STATUS_UNSUPPORTED_DTYPE); + || out->dtype == BF_DTYPE_CF64, BF_STATUS_UNSUPPORTED_DTYPE); BF_CHECK_CUDA_EXCEPTION(cudaGetLastError(), BF_STATUS_INTERNAL_ERROR); diff --git a/src/test_fft.cu b/src/test_fft.cu deleted file mode 100644 index 8f2b55f7d..000000000 --- a/src/test_fft.cu +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Bifrost Authors nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*! \file testfft.cu - * \brief This file tests the fft.cu functionality. - */ - -#include "fft.cu" -#include -#include - -/*! \brief Simple test of 2 dimensional real data - * through a forward bfFFT. - */ -TEST(FFTTest, Handles2dReal) -{ - /// Set up the test with a 3x2 element real array - BFarray dataAndDescription; - BFarray outputDataAndDescription; - cufftReal hostData[3][2] = - {{1,2},{2,3},{3,4}}; - cufftReal** deviceData; - cufftComplex outputHostData[3][2] = {}; - cufftComplex** outputDeviceData; - /// Load the test array to the GPU - cudaMalloc((void**)&deviceData, sizeof(cufftReal)*6); - cudaMalloc((void**)&outputDeviceData, sizeof(cufftComplex)*6); - cudaMemcpy( - deviceData, hostData, - sizeof(cufftReal)*6, cudaMemcpyHostToDevice); - /// Describe our input and output data - dataAndDescription.data = deviceData; - dataAndDescription.space = BF_SPACE_CUDA; - dataAndDescription.shape[0] = 3; - dataAndDescription.shape[1] = 2; - dataAndDescription.dtype = 0; - dataAndDescription.ndim = 2; - dataAndDescription.strides[0] = 2*sizeof(cufftReal); - dataAndDescription.strides[1] = sizeof(cufftReal); - outputDataAndDescription = dataAndDescription; - outputDataAndDescription.data = outputDeviceData; - outputDataAndDescription.dtype = 1; - outputDataAndDescription.strides[0] = 2*sizeof(cufftComplex); - outputDataAndDescription.strides[1] = sizeof(cufftComplex); - - /// Perform the forward FFT in the separate output object - bfFFT(&dataAndDescription, &outputDataAndDescription, FFT_FORWARD); - /// Download the data back from the GPU - cudaMemcpy( - outputHostData, (cufftComplex*)outputDataAndDescription.data, - sizeof(cufftComplex)*6, cudaMemcpyDeviceToHost); - - /// Did the FFT produce the correct result? - /// We check this only with one value. - EXPECT_EQ(cuCrealf(outputHostData[0][0]),15); -} - -/*! \brief Simple test of 1 dimensional real data - * through a forward bfFFT. - */ -TEST(FFTTest, Handles1dReal) -{ - /// Set up the test with a 4 element real array - BFarray dataAndDescription; - BFarray outputDataAndDescription; - cufftReal hostData[4] = {1,3,6,4.5}; - cufftReal* deviceData; - cufftComplex outputHostData[3]; - cufftComplex* outputDeviceData; - /// Load this array to the GPU - cudaMalloc((void**)&deviceData, sizeof(cufftReal)*5); - cudaMalloc((void**)&outputDeviceData, sizeof(cufftComplex)*3); - cudaMemcpy( - deviceData, hostData, - sizeof(cufftReal)*4, cudaMemcpyHostToDevice); - /// Describe our input and output data - dataAndDescription.data = deviceData; - dataAndDescription.space = BF_SPACE_CUDA; - dataAndDescription.shape[0] = 4; - dataAndDescription.dtype = 0; - dataAndDescription.ndim = 1; - dataAndDescription.strides[0] = sizeof(cufftReal); - /// Output data is a different type, so requires - /// a separate output object - outputDataAndDescription = dataAndDescription; - outputDataAndDescription.data = outputDeviceData; - outputDataAndDescription.dtype = 1; - outputDataAndDescription.strides[0] = sizeof(cufftComplex); - - /// Perform the forward FFT into the separate output data - bfFFT(&dataAndDescription, &outputDataAndDescription, FFT_FORWARD); - /// Download the data back from the GPU - cudaMemcpy( - outputHostData, (cufftComplex*)outputDataAndDescription.data, - sizeof(cufftComplex)*3, cudaMemcpyDeviceToHost); - - /// Did the FFT produce the correct result? - /// We check this only with one value. - EXPECT_EQ((int)cuCimagf(outputHostData[1]), 1); -} - -/*! \brief Simple test of 2 dimensional complex data - * through a forward bfFFT. - */ -TEST(FFTTest, Handles2dComplex) -{ - /// Set up the test with a 3x3 element complex array - BFarray dataAndDescription; - cufftComplex hostData[3][3] = - {{{5,1},{0,0},{100,0}}, - {{5,1},{30,0},{100,0}}, - {{30,0},{0,0},{10,1}}}; - /// Load this array to the GPU - cufftComplex** deviceData; - cudaMalloc((void**)&deviceData, sizeof(cufftComplex)*9); - cudaMemcpy( - deviceData, hostData, - sizeof(cufftComplex)*9, cudaMemcpyHostToDevice); - dataAndDescription.data = deviceData; - /// Describe our data - dataAndDescription.space = BF_SPACE_CUDA; - dataAndDescription.shape[0] = 3; - dataAndDescription.shape[1] = 3; - dataAndDescription.dtype = 1; - dataAndDescription.ndim = 2; - dataAndDescription.strides[0] = 3*sizeof(cufftComplex); - dataAndDescription.strides[1] = sizeof(cufftComplex); - - /// Perform the forward FFT in place - bfFFT(&dataAndDescription, &dataAndDescription, FFT_FORWARD); - /// Dowload data back from the GPU - cudaMemcpy( - hostData, (cufftComplex**)dataAndDescription.data, - sizeof(cufftComplex)*9, cudaMemcpyDeviceToHost); - - /// Did the FFT produce the correct result? - /// We check this only with one value. - EXPECT_EQ((int)cuCimagf(hostData[2][2]), -125); -} - -/*! \brief Simple test of 1 dimensional complex data - * through an inverse bfFFT. - */ -TEST(FFTTest, InverseC2C) -{ - /// Set up the test with a 5 element complex array - BFarray dataAndDescription; - cufftComplex hostData[5] = {{0,-1},{0,0},{100,-100},{30,0},{-5,0}}; - /// Load this array to the GPU - cufftComplex* deviceData; - cudaMalloc((void**)&deviceData, sizeof(cufftComplex)*5); - cudaMemcpy(deviceData, hostData, sizeof(cufftComplex)*5, cudaMemcpyHostToDevice); - dataAndDescription.data = deviceData; - /// Describe our data - dataAndDescription.space = BF_SPACE_CUDA; - dataAndDescription.shape[0] = 5; - dataAndDescription.dtype = 1; - dataAndDescription.ndim = 1; - dataAndDescription.strides[0] = sizeof(cufftComplex); - - /// Perform the inverse FFT in place - bfFFT(&dataAndDescription, &dataAndDescription, FFT_INVERSE); - /// Download back from the GPU - cudaMemcpy( - hostData, (cufftComplex*)dataAndDescription.data, - sizeof(cufftComplex)*5, cudaMemcpyDeviceToHost); - - /// Did the FFT produce the correct answer? - EXPECT_EQ((int)cuCrealf(hostData[3]),139); -} - -// TODO: Make this data actually complex aside from type -/*! \brief Simple test of 1 dimensional complex data - * through a forward bfFFT. - */ -TEST(FFTTest, Handles1dComplex) -{ - /// Set up the test with a 5 element complex array - BFarray dataAndDescription; - cufftComplex hostData[5] = - {{0,0},{30,0},{100,0},{30,0},{-5,0}}; - /// Load this array to the GPU - cufftComplex* deviceData; - cudaMalloc((void**)&deviceData, sizeof(cufftComplex)*5); - cudaMemcpy(deviceData, hostData, sizeof(cufftComplex)*5, cudaMemcpyHostToDevice); - dataAndDescription.data = deviceData; - /// Describe our data - dataAndDescription.space = BF_SPACE_CUDA; - dataAndDescription.shape[0] = 5; - dataAndDescription.dtype = 1; - dataAndDescription.ndim = 1; - dataAndDescription.strides[0] = sizeof(cufftComplex); - - /// Perform the forward FFT in place - bfFFT(&dataAndDescription, &dataAndDescription, FFT_FORWARD); - /// Download back from the GPU. - cudaMemcpy( - hostData, (cufftComplex*)dataAndDescription.data, - sizeof(cufftComplex)*5, cudaMemcpyDeviceToHost); - - /// Test a single value of the output, to test for - /// the FFT's correct answer? - EXPECT_EQ((int)cuCimagf(hostData[4]),(int)74.431946); -} - -// TODO: Add task functionality for rings? -// TODO: Add test for multiple GPUs. -// TODO: Add test for type conversion. - -int main(int argc, char** argv) -{ - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/src/testsuite.cpp b/src/testsuite.cpp new file mode 100644 index 000000000..3f981eae0 --- /dev/null +++ b/src/testsuite.cpp @@ -0,0 +1,204 @@ +/* -*- indent-tabs-mode:nil -*- + * Copyright (c) 2022, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include // For getpid +#include // For getpid +#include +#include +#include +#include + +using namespace std; + +// General output format, used for tracing and error reporting. +#define TPRINT(level, arg) \ + (cout << "testsuite: " << level << ": " \ + << __FUNCTION__ << ": " << arg << " @" << __LINE__ << '\n') + +// Tracing for debug builds only. +#if BF_DEBUG_ENABLED +#define TDEBUG(arg) TPRINT("DEBUG", arg) +#else +#define TDEBUG(arg) {} +#endif + +// Final result of a test: use the inversion like exit() where 0 means success, +// so we can add to count the failures. +typedef enum { OK = 0, FAIL = 1 } TestResult; + +ostream& operator << (ostream& out, TestResult r) { + return out << (r == OK? "ok" : "FAIL"); +} + +// Assertions output on failure, whether or not debug build. +#define ASSERT(pred, mesg) \ + if(!(pred)) { TPRINT("ERROR", mesg); return FAIL; } + +#define ASSERT_PATH_EXISTS(path) \ + ASSERT(file_exists(path), "Path does not exist: " << path) + +#define ASSERT_PATH_NOT_EXISTS(path) \ + ASSERT(!file_exists(path), "Path exists: " << path) + +// Create a temporary directory for any file tests, then clean it up after. +struct TestDir { + char* path = NULL; + TestDir(); + ~TestDir(); + const string mkFileName(const string& baseName); + const string mkFile(const string& baseName); +}; + +TestDir::TestDir() { + // Find a temporary directory, either $TMPDIR or /tmp + const char *tmpdir = getenv("TMPDIR"); + if(tmpdir == NULL) { + tmpdir = "/tmp"; + } + // Buffer that mkdtemp can modify; it cannot use a string constant. + unsigned tmpdirLen = strlen(tmpdir); + path = new char [tmpdirLen + 40]; + strcpy(path, tmpdir); + // Add a slash if needed (TMPDIR on Mac may already end in slash?) + if(tmpdir[tmpdirLen-1] != '/') { + strcat(path, "/"); + } + strcat(path, "bifrost-testsuite.XXXXXX"); + if(mkdtemp(path) == NULL) { + throw runtime_error(string("mkdtemp failure creating ") + path); + } + TDEBUG("created " << path); +} + +TestDir::~TestDir() { + TDEBUG("removing " << path); + remove_files_recursively(path); + delete [] path; +} + +const string TestDir::mkFileName(const string& baseName) { + return string(path) + '/' + baseName; +} + +const string TestDir::mkFile(const string& baseName) { + string fname = mkFileName(baseName); + ofstream file (fname); + file.close(); + return fname; +} + +static TestResult test_this_process_exists() { + pid_t pid = getpid(); + ASSERT(process_exists(pid), "my PID " << pid << " not found."); + return OK; +} + +static TestResult test_dir() { + string path; + { TestDir tmp; + path = tmp.path; + ASSERT_PATH_EXISTS(path); + } + ASSERT_PATH_NOT_EXISTS(path); + return OK; +} + +static TestResult test_make_then_remove_dir() { + TestDir tmp; + string dir = tmp.mkFileName("w0w.d"); + TDEBUG("make_dir " << dir); + make_dir(dir); + ASSERT_PATH_EXISTS(dir); + + TDEBUG("remove_dir " << dir); + remove_dir(dir); + ASSERT_PATH_NOT_EXISTS(dir); + + return OK; +} + +static TestResult test_create_then_remove_file() { + TestDir tmp; + string fname = tmp.mkFile("rain.b0w"); + TDEBUG("mkFile " << fname); + ASSERT_PATH_EXISTS(fname); + + TDEBUG("remove_file " << fname); + remove_file(fname); + ASSERT_PATH_NOT_EXISTS(fname); + + return OK; +} + +static TestResult test_remove_files_by_extension() { + TestDir tmp; + // We'll glob-delete the .bak files and leave the rest. + vector names = + { "cheez.bak", "Floop.3.bak", + "cheez.txt", "zan.tex", "bobak", "lib.baks" + }; + + for(unsigned i = 0; i < names.size(); i++) { + names.at(i) = tmp.mkFile(names.at(i)); + TDEBUG("mkFile " << names.at(i)); + ASSERT_PATH_EXISTS(names.at(i)); + } + + TDEBUG("removing *.bak"); + remove_files_with_suffix(tmp.path, ".bak"); + + ASSERT_PATH_NOT_EXISTS(names.at(0)); + ASSERT_PATH_NOT_EXISTS(names.at(1)); + + ASSERT_PATH_EXISTS(names.at(2)); + ASSERT_PATH_EXISTS(names.at(3)); + ASSERT_PATH_EXISTS(names.at(4)); + ASSERT_PATH_EXISTS(names.at(5)); + return OK; +} + +int bfTestSuite() { + int numFails = 0; + + numFails += test_this_process_exists(); + numFails += test_dir(); + numFails += test_make_then_remove_dir(); + numFails += test_create_then_remove_file(); + numFails += test_remove_files_by_extension(); + + switch(numFails) { + case 0: TDEBUG("success"); break; + case 1: TDEBUG("1 failure"); break; + default: TDEBUG(numFails << " failures"); + } + return numFails; +} diff --git a/src/trace.hpp b/src/trace.hpp index 783bf9489..35aad52be 100644 --- a/src/trace.hpp +++ b/src/trace.hpp @@ -28,6 +28,7 @@ #pragma once +#include #include "cuda.hpp" #if BF_CUDA_ENABLED @@ -38,6 +39,7 @@ #include #include #include +#include #if BF_TRACE_ENABLED // Note: __PRETTY_FUNCTION__ is GCC-specific diff --git a/src/transpose.cu b/src/transpose.cu index 4acaafd96..1a6078b97 100644 --- a/src/transpose.cu +++ b/src/transpose.cu @@ -27,6 +27,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include "assert.hpp" @@ -378,13 +379,18 @@ BFstatus transpose_vector_read(BFarray const* in, } } std::string func_str; - func_str += "enum { K = " + std::to_string(K) + " };\n"; - func_str += - "in_type ivals = in(" + in_inds_str + ");\n" - "#pragma unroll\n" - "for( int k=0; k -#include -#include -using bifrost::ring::RingWrapper; -using bifrost::ring::RingWriter; -using bifrost::ring::WriteSpan; -using bifrost::ring::WriteSequence; -#include "proclog.hpp" - -#include // For ntohs -#include // For recvfrom - -#include -#include -#include -#include // For posix_memalign -#include // For memcpy, memset -#include - -#include -#include -#include -#include - -//#include // SSE - -// TODO: The VMA API is returning unaligned buffers, which prevents use of SSE -#ifndef BF_VMA_ENABLED -#define BF_VMA_ENABLED 0 -//#define BF_VMA_ENABLED 1 -#endif - -#ifndef BF_HWLOC_ENABLED -#define BF_HWLOC_ENABLED 0 -//#define BF_HWLOC_ENABLED 1 -#endif - -#define BF_UNPACK_FACTOR 1 - -enum { - JUMBO_FRAME_SIZE = 9000 -}; - -template -inline T atomic_add_and_fetch(T* dst, T val) { - return __sync_add_and_fetch(dst, val); // GCC builtin -} -template -inline T atomic_fetch_and_add(T* dst, T val) { - return __sync_fetch_and_add(dst, val); // GCC builtin -} - -// Wrap-safe comparisons -inline bool greater_equal(uint64_t a, uint64_t b) { return int64_t(a-b) >= 0; } -inline bool less_than( uint64_t a, uint64_t b) { return int64_t(a-b) < 0; } - -#if BF_VMA_ENABLED -#include -class VMAReceiver { - int _fd; - vma_api_t* _api; - vma_packet_t* _pkt; - inline void clean_cache() { - if( _pkt ) { - _api->free_packets(_fd, _pkt, 1); - _pkt = 0; - } - } -public: - VMAReceiver(int fd) - : _fd(fd), _api(vma_get_api()), _pkt(0) {} - VMAReceiver(VMAReceiver const& other) - : _fd(other._fd), _api(other._api), _pkt(0) {} - VMAReceiver& operator=(VMAReceiver const& other) { - if( &other != this ) { - this->clean_cache(); - _fd = other._fd; - _api = other._api; - } - return *this; - } - ~VMAReceiver() { this->clean_cache(); } - inline int recv_packet(uint8_t* buf, size_t bufsize, uint8_t** pkt_ptr, int flags=0) { - this->clean_cache(); - int ret = _api->recvfrom_zcopy(_fd, buf, bufsize, &flags, 0, 0); - if( ret < 0 ) { - return ret; - } - if( flags & MSG_VMA_ZCOPY ) { - _pkt = &((vma_packets_t*)buf)->pkts[0]; - *pkt_ptr = (uint8_t*)_pkt->iov[0].iov_base; - } else { - *pkt_ptr = buf; - } - return ret; - } - inline operator bool() const { return _api != NULL; } -}; -#endif // BF_VMA_ENABLED - -template -class AlignedBuffer { - enum { DEFAULT_ALIGNMENT = 4096 }; - T* _buf; - size_t _size; - size_t _alignment; - void alloc() { - int err = ::posix_memalign((void**)&_buf, _alignment, _size*sizeof(T)); - if( err ) { - throw std::runtime_error("Allocation failed"); - } - } - void copy(T const* srcbuf, size_t n) { - ::memcpy(_buf, srcbuf, n*sizeof(T)); - } - void free() { - if( _buf ) { - ::free(_buf); - _buf = 0; - _size = 0; - } - } -public: - //explicit AlignedBuffer(size_t alignment=DEFAULT_ALIGNMENT) - // : _buf(0), _size(0), _alignment(alignment) {} - AlignedBuffer(size_t size=0, size_t alignment=DEFAULT_ALIGNMENT) - : _buf(0), _size(size), _alignment(alignment) { - this->alloc(); - } - AlignedBuffer(AlignedBuffer const& other) - : _buf(0), _size(other.size), _alignment(other.alignment) { - this->alloc(); - this->copy(other._buf, other._size); - } - AlignedBuffer& operator=(AlignedBuffer const& other) { - if( &other != this ) { - this->free(); - _size = other.size; - _alignment = other.alignment; - this->alloc(); - this->copy(other._buf, other._size); - } - return *this; - } - ~AlignedBuffer() { - this->free(); - } - inline void swap(AlignedBuffer & other) { - std::swap(_buf, other._buf); - std::swap(_size, other._size); - std::swap(_alignment, other._alignment); - } - inline void resize(size_t n) { - if( n <= _size ) { - _size = n; - } else { - AlignedBuffer tmp(n, _alignment); - tmp.copy(&_buf[0], _size); - tmp.swap(*this); - } - } - inline size_t size() const { return _size; } - inline T & operator[](size_t i) { return _buf[i]; } - inline T const& operator[](size_t i) const { return _buf[i]; } -}; - -#if BF_HWLOC_ENABLED -#include -class HardwareLocality { - hwloc_topology_t _topo; - HardwareLocality(HardwareLocality const&); - HardwareLocality& operator=(HardwareLocality const&); -public: - HardwareLocality() { - hwloc_topology_init(&_topo); - hwloc_topology_load(_topo); - } - ~HardwareLocality() { - hwloc_topology_destroy(_topo); - } - int bind_memory_to_core(int core) { - int core_depth = hwloc_get_type_or_below_depth(_topo, HWLOC_OBJ_CORE); - int ncore = hwloc_get_nbobjs_by_depth(_topo, core_depth); - int ret = 0; - if( 0 <= core && core < ncore ) { - hwloc_obj_t obj = hwloc_get_obj_by_depth(_topo, core_depth, core); - hwloc_cpuset_t cpuset = hwloc_bitmap_dup(obj->cpuset); - hwloc_bitmap_singlify(cpuset); // Avoid hyper-threads - hwloc_membind_policy_t policy = HWLOC_MEMBIND_BIND; - hwloc_membind_flags_t flags = HWLOC_MEMBIND_THREAD; - ret = hwloc_set_membind(_topo, cpuset, policy, flags); - hwloc_bitmap_free(cpuset); - } - return ret; - } -}; -#endif // BF_HWLOC_ENABLED - -class BoundThread { -#if BF_HWLOC_ENABLED - HardwareLocality _hwloc; -#endif -public: - BoundThread(int core) { - bfAffinitySetCore(core); -#if BF_HWLOC_ENABLED - assert(_hwloc.bind_memory_to_core(core) == 0); -#endif - } -}; - -class UDPPacketReceiver { - int _fd; - AlignedBuffer _buf; -#if BF_VMA_ENABLED - VMAReceiver _vma; -#endif -public: - UDPPacketReceiver(int fd, size_t pkt_size_max=JUMBO_FRAME_SIZE) - : _fd(fd), _buf(pkt_size_max) -#if BF_VMA_ENABLED - , _vma(fd) -#endif - {} - inline int recv_packet(uint8_t** pkt_ptr, int flags=0) { -#if BF_VMA_ENABLED - if( _vma ) { - *pkt_ptr = 0; - return _vma.recv_packet(&_buf[0], _buf.size(), pkt_ptr, flags); - } else { -#endif - *pkt_ptr = &_buf[0]; - return ::recvfrom(_fd, &_buf[0], _buf.size(), flags, 0, 0); -#if BF_VMA_ENABLED - } -#endif - } -}; - -struct PacketDesc { - uint64_t seq; - int nsrc; - int src; - int nchan; - int chan0; - int payload_size; - const uint8_t* payload_ptr; -}; -struct PacketStats { - size_t ninvalid; - size_t ninvalid_bytes; - size_t nlate; - size_t nlate_bytes; - size_t nvalid; - size_t nvalid_bytes; -}; - -class UDPCaptureThread : public BoundThread { - UDPPacketReceiver _udp; - PacketStats _stats; - std::vector _src_stats; - bool _have_pkt; - PacketDesc _pkt; -public: - enum { - CAPTURE_SUCCESS = 1 << 0, - CAPTURE_TIMEOUT = 1 << 1, - CAPTURE_INTERRUPTED = 1 << 2, - CAPTURE_ERROR = 1 << 3 - }; - UDPCaptureThread(int fd, int nsrc, int core=0, size_t pkt_size_max=9000) - : BoundThread(core), _udp(fd, pkt_size_max), _src_stats(nsrc), - _have_pkt(false) { - this->reset_stats(); - } - // Captures, decodes and unpacks packets into the provided buffers - // Note: Capture continues until the first packet that belongs - // beyond the end of the provided buffers. This packet is - // saved, accessible via get_last_packet(), and will be - // processed on the next call to run() if possible. - template - int run(uint64_t seq_beg, - uint64_t nseq_per_obuf, - int nbuf, - uint8_t* obufs[], - size_t* ngood_bytes[], - size_t* src_ngood_bytes[], - PacketDecoder* decode, - PacketProcessor* process) { - uint64_t seq_end = seq_beg + nbuf*nseq_per_obuf; - size_t local_ngood_bytes[2] = {0, 0}; - int ret; - while( true ) { - if( !_have_pkt ) { - uint8_t* pkt_ptr; - int pkt_size = _udp.recv_packet(&pkt_ptr); - if( pkt_size <= 0 ) { - if( errno == EAGAIN || errno == EWOULDBLOCK ) { - ret = CAPTURE_TIMEOUT; // Timed out - } else if( errno == EINTR ) { - ret = CAPTURE_INTERRUPTED; // Interrupted by signal - } else { - ret = CAPTURE_ERROR; // Socket error - } - break; - } - if( !(*decode)(pkt_ptr, pkt_size, &_pkt) ) { - ++_stats.ninvalid; - _stats.ninvalid_bytes += pkt_size; - continue; - } - _have_pkt = true; - } - if( greater_equal(_pkt.seq, seq_end) ) { - // Reached the end of this processing gulp, so leave this - // packet unprocessed and return. - ret = CAPTURE_SUCCESS; - break; - } - _have_pkt = false; - if( less_than(_pkt.seq, seq_beg) ) { - ++_stats.nlate; - _stats.nlate_bytes += _pkt.payload_size; - ++_src_stats[_pkt.src].nlate; - _src_stats[_pkt.src].nlate_bytes += _pkt.payload_size; - continue; - } - ++_stats.nvalid; - _stats.nvalid_bytes += _pkt.payload_size; - ++_src_stats[_pkt.src].nvalid; - _src_stats[_pkt.src].nvalid_bytes += _pkt.payload_size; - // HACK TODO: src_ngood_bytes should be accumulated locally and - // then atomically updated, like ngood_bytes. The - // current way is not thread-safe. - (*process)(&_pkt, seq_beg, nseq_per_obuf, nbuf, obufs, - local_ngood_bytes, /*local_*/src_ngood_bytes); - } - if( nbuf > 0 ) { atomic_add_and_fetch(ngood_bytes[0], local_ngood_bytes[0]); } - if( nbuf > 1 ) { atomic_add_and_fetch(ngood_bytes[1], local_ngood_bytes[1]); } - return ret; - } - inline const PacketDesc* get_last_packet() const { - return _have_pkt ? &_pkt : NULL; - } - inline const PacketStats* get_stats() const { return &_stats; } - inline const PacketStats* get_stats(int src) const { return &_src_stats[src]; } - inline void reset_stats() { - ::memset(&_stats, 0, sizeof(_stats)); - ::memset(&_src_stats[0], 0, _src_stats.size()*sizeof(PacketStats)); - } -}; - -#pragma pack(1) -struct chips_hdr_type { - uint8_t roach; // Note: 1-based - uint8_t gbe; // (AKA tuning) - uint8_t nchan; // 109 - uint8_t nsubband; // 11 - uint8_t subband; // 0-11 - uint8_t nroach; // 16 - // Note: Big endian - uint16_t chan0; // First chan in packet - uint64_t seq; // Note: 1-based -}; - -class CHIPSDecoder { - // TODO: See if can remove these once firmware supports per-GbE nroach - int _nsrc; - int _src0; - inline bool valid_packet(const PacketDesc* pkt) const { - return (pkt->seq >= 0 && - pkt->src >= 0 && pkt->src < _nsrc && - pkt->chan0 >= 0); - } -public: - CHIPSDecoder(int nsrc, int src0) : _nsrc(nsrc), _src0(src0) {} - inline bool operator()(const uint8_t* pkt_ptr, - int pkt_size, - PacketDesc* pkt) const { - if( pkt_size < (int)sizeof(chips_hdr_type) ) { - return false; - } - const chips_hdr_type* pkt_hdr = (chips_hdr_type*)pkt_ptr; - const uint8_t* pkt_pld = pkt_ptr + sizeof(chips_hdr_type); - int pld_size = pkt_size - sizeof(chips_hdr_type); - pkt->seq = be64toh(pkt_hdr->seq) - 1; - //pkt->nsrc = pkt_hdr->nroach; - pkt->nsrc = _nsrc; - pkt->src = (pkt_hdr->roach - 1) - _src0; - pkt->nchan = pkt_hdr->nchan; - pkt->chan0 = ntohs(pkt_hdr->chan0); - pkt->payload_size = pld_size; - pkt->payload_ptr = pkt_pld; - return this->valid_packet(pkt); - } -}; - -struct __attribute__((aligned(32))) aligned256_type { - uint8_t data[32]; -}; -struct __attribute__((aligned(64))) aligned512_type { - uint8_t data[64]; -}; - -class CHIPSProcessor8bit { -public: - inline void operator()(const PacketDesc* pkt, - uint64_t seq0, - uint64_t nseq_per_obuf, - int nbuf, - uint8_t* obufs[], - size_t ngood_bytes[], - size_t* src_ngood_bytes[]) { - enum { - PKT_NINPUT = 32, - PKT_NBIT = 4 - }; - int obuf_idx = ((pkt->seq - seq0 >= 1*nseq_per_obuf) + - (pkt->seq - seq0 >= 2*nseq_per_obuf)); - size_t obuf_seq0 = seq0 + obuf_idx*nseq_per_obuf; - size_t nbyte = pkt->payload_size * BF_UNPACK_FACTOR; - ngood_bytes[obuf_idx] += nbyte; - src_ngood_bytes[obuf_idx][pkt->src] += nbyte; - // **CHANGED RECENTLY - int payload_size = pkt->payload_size;//pkt->nchan*(PKT_NINPUT*2*PKT_NBIT/8); - - size_t obuf_offset = (pkt->seq-obuf_seq0)*pkt->nsrc*payload_size; - typedef aligned256_type itype; - typedef aligned256_type otype; - - obuf_offset *= BF_UNPACK_FACTOR; - - // Note: Using these SSE types allows the compiler to use SSE instructions - // However, they require aligned memory (otherwise segfault) - itype const* __restrict__ in = (itype const*)pkt->payload_ptr; - otype* __restrict__ out = (otype* )&obufs[obuf_idx][obuf_offset]; - - int chan = 0; - //cout << pkt->src << ", " << pkt->nsrc << endl; - //cout << pkt->nchan << endl; - /* - // HACK TESTING disabled - for( ; channchan/4*4; chan+=4 ) { - __m128i tmp0 = ((__m128i*)&in[chan])[0]; - __m128i tmp1 = ((__m128i*)&in[chan])[1]; - __m128i tmp2 = ((__m128i*)&in[chan+1])[0]; - __m128i tmp3 = ((__m128i*)&in[chan+1])[1]; - __m128i tmp4 = ((__m128i*)&in[chan+2])[0]; - __m128i tmp5 = ((__m128i*)&in[chan+2])[1]; - __m128i tmp6 = ((__m128i*)&in[chan+3])[0]; - __m128i tmp7 = ((__m128i*)&in[chan+3])[1]; - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*chan])[0], tmp0); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*chan])[1], tmp1); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*(chan+1)])[0], tmp2); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*(chan+1)])[1], tmp3); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*(chan+2)])[0], tmp4); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*(chan+2)])[1], tmp5); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*(chan+3)])[0], tmp6); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*(chan+3)])[1], tmp7); - } - */ - //for( ; channchan; ++chan ) { - /* - for( ; chan<10; ++chan ) { // HACK TESTING - __m128i tmp0 = ((__m128i*)&in[chan])[0]; - __m128i tmp1 = ((__m128i*)&in[chan])[1]; - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*chan])[0], tmp0); - _mm_store_si128(&((__m128i*)&out[pkt->src + pkt->nsrc*chan])[1], tmp1); - } - */ - //if( pkt->src < 8 ) { // HACK TESTING - //for( ; chan<32; ++chan ) { // HACK TESTING - for( ; channchan; ++chan ) { // HACK TESTING - out[pkt->src + pkt->nsrc*chan] = in[chan]; - //::memset( - } - //} - } - inline void blank_out_source(uint8_t* data, - int src, - int nsrc, - int nchan, - int nseq) { - typedef aligned256_type otype; - otype* __restrict__ aligned_data = (otype*)data; - for( int t=0; t _process_time; - std::chrono::duration _reserve_time; - - int _nsrc; - int _nseq_per_buf; - int _slot_ntime; - BFoffset _seq; - int _chan0; - int _nchan; - int _payload_size; - bool _active; - BFudpcapture_sequence_callback _sequence_callback; - - RingWrapper _ring; - RingWriter _oring; - std::queue > _bufs; - std::queue _buf_ngood_bytes; - std::queue > _buf_src_ngood_bytes; - std::shared_ptr _sequence; - size_t _ngood_bytes; - size_t _nmissing_bytes; - - inline size_t bufsize(int payload_size=-1) { - if( payload_size == -1 ) { - payload_size = _payload_size; - } - return _nseq_per_buf * _nsrc * payload_size * BF_UNPACK_FACTOR; - } - inline void reserve_buf() { - _buf_ngood_bytes.push(0); - _buf_src_ngood_bytes.push(std::vector(_nsrc, 0)); - size_t size = this->bufsize(); - // TODO: Can make this simpler? - _bufs.push(std::shared_ptr(new bifrost::ring::WriteSpan(_oring, size))); - } - inline void commit_buf() { - size_t expected_bytes = _bufs.front()->size(); - - for( int src=0; src<_nsrc; ++src ) { - // TODO: This assumes all sources contribute equally; should really - // allow non-uniform partitioning. - size_t src_expected_bytes = expected_bytes / _nsrc; - size_t src_ngood_bytes = _buf_src_ngood_bytes.front()[src]; - size_t src_nmissing_bytes = src_expected_bytes - src_ngood_bytes; - // Detect >50% missing data from this source - if( src_nmissing_bytes > src_ngood_bytes ) { - // Zero-out this source's contribution to the buffer - uint8_t* data = (uint8_t*)_bufs.front()->data(); - _processor.blank_out_source(data, src, _nsrc, - _nchan, _nseq_per_buf); - } - } - _buf_src_ngood_bytes.pop(); - - _ngood_bytes += _buf_ngood_bytes.front(); - //_nmissing_bytes += _bufs.front()->size() - _buf_ngood_bytes.front(); - //// HACK TESTING 15/16 correction for missing roach11 - //_nmissing_bytes += _bufs.front()->size()*15/16 - _buf_ngood_bytes.front(); - _nmissing_bytes += expected_bytes - _buf_ngood_bytes.front(); - _buf_ngood_bytes.pop(); - - _bufs.front()->commit(); - _bufs.pop(); - _seq += _nseq_per_buf; - } - inline void begin_sequence() { - BFoffset seq0 = _seq;// + _nseq_per_buf*_bufs.size(); - const void* hdr; - size_t hdr_size; - BFoffset time_tag; - if( _sequence_callback ) { - int status = (*_sequence_callback)(seq0, - _chan0, - _nchan, - _nsrc, - &time_tag, - &hdr, - &hdr_size); - if( status != 0 ) { - // TODO: What to do here? Needed? - throw std::runtime_error("BAD HEADER CALLBACK STATUS"); - } - } else { - // Simple default for easy testing - time_tag = seq0; - hdr = NULL; - hdr_size = 0; - } - const char* name = ""; - int nringlet = 1; - _sequence.reset(new WriteSequence(_oring, name, time_tag, - hdr_size, hdr, nringlet)); - } - inline void end_sequence() { - _sequence.reset(); // Note: This is releasing the shared_ptr - } -public: - inline BFudpcapture_impl(int fd, - BFring ring, - int nsrc, - int src0, - int max_payload_size, - int buffer_ntime, - int slot_ntime, - BFudpcapture_sequence_callback sequence_callback, - int core) - : _capture(fd, nsrc, core), _decoder(nsrc, src0), _processor(), - _type_log("udp_capture/type"), - _bind_log("udp_capture/bind"), - _out_log("udp_capture/out"), - _size_log("udp_capture/sizes"), - _chan_log("udp_capture/chans"), - _stat_log("udp_capture/stats"), - _perf_log("udp_capture/perf"), - _nsrc(nsrc), _nseq_per_buf(buffer_ntime), _slot_ntime(slot_ntime), - _seq(), _chan0(), _nchan(), _active(false), - _sequence_callback(sequence_callback), - _ring(ring), _oring(_ring), - // TODO: Add reset method for stats - _ngood_bytes(0), _nmissing_bytes(0) { - size_t contig_span = this->bufsize(max_payload_size); - // Note: 2 write bufs may be open for writing at one time - size_t total_span = contig_span * 4; - size_t nringlet_max = 1; - _ring.resize(contig_span, total_span, nringlet_max); - _type_log.update("type : %s", "chips"); - _bind_log.update("ncore : %i\n" - "core0 : %i\n", - 1, core); - _out_log.update("nring : %i\n" - "ring0 : %s\n", - 1, _ring.name()); - _size_log.update("nsrc : %i\n" - "nseq_per_buf : %i\n" - "slot_ntime : %i\n", - _nsrc, _nseq_per_buf, _slot_ntime); - } - inline void flush() { - while( _bufs.size() ) { - this->commit_buf(); - } - if( _sequence ) { - this->end_sequence(); - } - } - inline void end_writing() { - this->flush(); - _oring.close(); - } - BFudpcapture_status recv() { - _t0 = std::chrono::high_resolution_clock::now(); - - uint8_t* buf_ptrs[2]; - // Minor HACK to access the buffers in a 2-element queue - buf_ptrs[0] = _bufs.size() > 0 ? (uint8_t*)_bufs.front()->data() : NULL; - buf_ptrs[1] = _bufs.size() > 1 ? (uint8_t*)_bufs.back()->data() : NULL; - - size_t* ngood_bytes_ptrs[2]; - ngood_bytes_ptrs[0] = _buf_ngood_bytes.size() > 0 ? &_buf_ngood_bytes.front() : NULL; - ngood_bytes_ptrs[1] = _buf_ngood_bytes.size() > 1 ? &_buf_ngood_bytes.back() : NULL; - - size_t* src_ngood_bytes_ptrs[2]; - src_ngood_bytes_ptrs[0] = _buf_src_ngood_bytes.size() > 0 ? &_buf_src_ngood_bytes.front()[0] : NULL; - src_ngood_bytes_ptrs[1] = _buf_src_ngood_bytes.size() > 1 ? &_buf_src_ngood_bytes.back()[0] : NULL; - - int state = _capture.run(_seq, - _nseq_per_buf, - _bufs.size(), - buf_ptrs, - ngood_bytes_ptrs, - src_ngood_bytes_ptrs, - &_decoder, - &_processor); - if( state & UDPCaptureThread::CAPTURE_ERROR ) { - return BF_CAPTURE_ERROR; - } else if( state & UDPCaptureThread::CAPTURE_INTERRUPTED ) { - return BF_CAPTURE_INTERRUPTED; - } - const PacketStats* stats = _capture.get_stats(); - _stat_log.update() << "ngood_bytes : " << _ngood_bytes << "\n" - << "nmissing_bytes : " << _nmissing_bytes << "\n" - << "ninvalid : " << stats->ninvalid << "\n" - << "ninvalid_bytes : " << stats->ninvalid_bytes << "\n" - << "nlate : " << stats->nlate << "\n" - << "nlate_bytes : " << stats->nlate_bytes << "\n" - << "nvalid : " << stats->nvalid << "\n" - << "nvalid_bytes : " << stats->nvalid_bytes << "\n"; - - _t1 = std::chrono::high_resolution_clock::now(); - - BFudpcapture_status ret; - bool was_active = _active; - _active = state & UDPCaptureThread::CAPTURE_SUCCESS; - if( _active ) { - const PacketDesc* pkt = _capture.get_last_packet(); - if( pkt ) { - //cout << "Latest nchan, chan0 = " << pkt->nchan << ", " << pkt->chan0 << endl; - } - else { - //cout << "No latest packet" << endl; - } - if( !was_active ) { - //cout << "Beginning of sequence, first pkt seq = " << pkt->seq << endl; - // TODO: Might be safer to round to nearest here, but the current firmware - // always starts things ~3 seq's before the 1sec boundary anyway. - //seq = round_up(pkt->seq, _slot_ntime); - //*_seq = round_nearest(pkt->seq, _slot_ntime); - _seq = round_up(pkt->seq, _slot_ntime); - _chan0 = pkt->chan0; - _nchan = pkt->nchan; - _payload_size = pkt->payload_size; - _chan_log.update() << "chan0 : " << _chan0 << "\n" - << "nchan : " << _nchan << "\n" - << "payload_size : " << _payload_size << "\n"; - this->begin_sequence(); - ret = BF_CAPTURE_STARTED; - } else { - //cout << "Continuing data, seq = " << seq << endl; - if( pkt->chan0 != _chan0 || - pkt->nchan != _nchan ) { - _chan0 = pkt->chan0; - _nchan = pkt->nchan; - _payload_size = pkt->payload_size; - _chan_log.update() << "chan0 : " << _chan0 << "\n" - << "nchan : " << _nchan << "\n" - << "payload_size : " << _payload_size << "\n"; - this->end_sequence(); - this->begin_sequence(); - ret = BF_CAPTURE_CHANGED; - } else { - ret = BF_CAPTURE_CONTINUED; - } - } - if( _bufs.size() == 2 ) { - this->commit_buf(); - } - this->reserve_buf(); - } else { - - if( was_active ) { - this->flush(); - ret = BF_CAPTURE_ENDED; - } else { - ret = BF_CAPTURE_NO_DATA; - } - } - - _t2 = std::chrono::high_resolution_clock::now(); - _process_time = std::chrono::duration_cast>(_t1-_t0); - _reserve_time = std::chrono::duration_cast>(_t2-_t1); - _perf_log.update() << "acquire_time : " << -1.0 << "\n" - << "process_time : " << _process_time.count() << "\n" - << "reserve_time : " << _reserve_time.count() << "\n"; - - return ret; - } -}; - -BFstatus bfUdpCaptureCreate(BFudpcapture* obj, - const char* format, - int fd, - BFring ring, - BFsize nsrc, - BFsize src0, - BFsize max_payload_size, - BFsize buffer_ntime, - BFsize slot_ntime, - BFudpcapture_sequence_callback sequence_callback, - int core) { - BF_ASSERT(obj, BF_STATUS_INVALID_POINTER); - if( format == std::string("chips") ) { - BF_TRY_RETURN_ELSE(*obj = new BFudpcapture_impl(fd, ring, nsrc, src0, max_payload_size, - buffer_ntime, slot_ntime, - sequence_callback, core), - *obj = 0); - } else { - return BF_STATUS_UNSUPPORTED; - } -} -BFstatus bfUdpCaptureDestroy(BFudpcapture obj) { - BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); - delete obj; - return BF_STATUS_SUCCESS; -} -BFstatus bfUdpCaptureRecv(BFudpcapture obj, BFudpcapture_status* result) { - BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); - BF_TRY_RETURN_ELSE(*result = obj->recv(), - *result = BF_CAPTURE_ERROR); -} -BFstatus bfUdpCaptureFlush(BFudpcapture obj) { - BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); - BF_TRY_RETURN(obj->flush()); -} -BFstatus bfUdpCaptureEnd(BFudpcapture obj) { - BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); - BF_TRY_RETURN(obj->end_writing()); -} diff --git a/src/udp_socket.cpp b/src/udp_socket.cpp index 4af7babbe..bd2cd10b4 100644 --- a/src/udp_socket.cpp +++ b/src/udp_socket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,7 @@ struct BFudpsocket_impl : public Socket { BFstatus bfUdpSocketCreate(BFudpsocket* obj) { BF_ASSERT(obj, BF_STATUS_INVALID_POINTER); - BF_TRY_RETURN_ELSE(*obj = (BFudpsocket)new BFudpsocket_impl(),//BFudpsocket_impl::SOCK_DGRAM), + BF_TRY_RETURN_ELSE(*obj = (BFudpsocket)new BFudpsocket_impl(),//SOCK_DGRAM), *obj = 0); } BFstatus bfUdpSocketDestroy(BFudpsocket obj) { @@ -55,6 +55,11 @@ BFstatus bfUdpSocketBind( BFudpsocket obj, BFaddress local_addr) { BF_ASSERT(local_addr, BF_STATUS_INVALID_ARGUMENT); BF_TRY_RETURN(obj->bind(*(sockaddr_storage*)local_addr)); } +BFstatus bfUdpSocketSniff( BFudpsocket obj, BFaddress local_addr) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_ASSERT(local_addr, BF_STATUS_INVALID_ARGUMENT); + BF_TRY_RETURN(obj->sniff(*(sockaddr_storage*)local_addr)); +} BFstatus bfUdpSocketShutdown(BFudpsocket obj) { BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); BF_TRY_RETURN(obj->shutdown()); @@ -85,6 +90,27 @@ BFstatus bfUdpSocketGetTimeout(BFudpsocket obj, double* secs) { //BF_TRY(*secs = obj->get_timeout(), // *secs = 0); } +BFstatus bfUdpSocketSetPromiscuous(BFudpsocket obj, int state) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_TRY_RETURN(obj->set_promiscuous(state)); +} +BFstatus bfUdpSocketGetPromiscuous(BFudpsocket obj, int* promisc) { + BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); + BF_ASSERT(promisc, BF_STATUS_INVALID_POINTER); + // WAR for old Socket implem returning Socket::Error not BFexception + try { + *promisc = obj->get_promiscuous(); + } + catch( Socket::Error& ) { + *promisc = 0; + return BF_STATUS_INVALID_STATE; + } + catch(...) { + *promisc = 0; + return BF_STATUS_INTERNAL_ERROR; + } + return BF_STATUS_SUCCESS; +} BFstatus bfUdpSocketGetMTU(BFudpsocket obj, int* mtu) { BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); BF_ASSERT(mtu, BF_STATUS_INVALID_POINTER); diff --git a/src/udp_transmit.cpp b/src/udp_transmit.cpp deleted file mode 100644 index a470c8e76..000000000 --- a/src/udp_transmit.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2017, The Bifrost Authors. All rights reserved. - * Copyright (c) 2017, The University of New Mexico. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Bifrost Authors nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "assert.hpp" -#include -#include -#include "proclog.hpp" - -#include // For ntohs -#include // For recvfrom - -#include -#include -#include -#include // For posix_memalign -#include // For memcpy, memset -#include - -#include -#include -#include - -#if BF_HWLOC_ENABLED -#include -class HardwareLocality { - hwloc_topology_t _topo; - HardwareLocality(HardwareLocality const&); - HardwareLocality& operator=(HardwareLocality const&); -public: - HardwareLocality() { - hwloc_topology_init(&_topo); - hwloc_topology_load(_topo); - } - ~HardwareLocality() { - hwloc_topology_destroy(_topo); - } - int bind_memory_to_core(int core) { - int core_depth = hwloc_get_type_or_below_depth(_topo, HWLOC_OBJ_CORE); - int ncore = hwloc_get_nbobjs_by_depth(_topo, core_depth); - int ret = 0; - if( 0 <= core && core < ncore ) { - hwloc_obj_t obj = hwloc_get_obj_by_depth(_topo, core_depth, core); - hwloc_cpuset_t cpuset = hwloc_bitmap_dup(obj->cpuset); - hwloc_bitmap_singlify(cpuset); // Avoid hyper-threads - hwloc_membind_policy_t policy = HWLOC_MEMBIND_BIND; - hwloc_membind_flags_t flags = HWLOC_MEMBIND_THREAD; - ret = hwloc_set_membind(_topo, cpuset, policy, flags); - hwloc_bitmap_free(cpuset); - } - return ret; - } -}; -#endif // BF_HWLOC_ENABLED - -class BoundThread { -#if BF_HWLOC_ENABLED - HardwareLocality _hwloc; -#endif -public: - BoundThread(int core) { - bfAffinitySetCore(core); -#if BF_HWLOC_ENABLED - assert(_hwloc.bind_memory_to_core(core) == 0); -#endif - } -}; - -struct PacketStats { - size_t ninvalid; - size_t ninvalid_bytes; - size_t nlate; - size_t nlate_bytes; - size_t nvalid; - size_t nvalid_bytes; -}; - -class UDPTransmitThread : public BoundThread { - PacketStats _stats; - - int _fd; - -public: - UDPTransmitThread(int fd, int core=0) - : BoundThread(core), _fd(fd) { - this->reset_stats(); - } - inline ssize_t send(msghdr* packet) { - ssize_t nsent = sendmsg(_fd, packet, 0); - if( nsent == -1 ) { - ++_stats.ninvalid; - _stats.ninvalid_bytes += packet->msg_iovlen; - } else { - ++_stats.nvalid; - _stats.nvalid_bytes += nsent; - } - return nsent; - } - inline ssize_t sendmany(mmsghdr *packets, unsigned int npackets) { - ssize_t nsent = sendmmsg(_fd, packets, npackets, 0); - if( nsent == -1 ) { - _stats.ninvalid += npackets; - _stats.ninvalid_bytes += npackets * packets->msg_len; - } else { - _stats.nvalid += npackets; - _stats.nvalid_bytes += npackets * packets->msg_len; - } - return nsent; - } - inline const PacketStats* get_stats() const { return &_stats; } - inline void reset_stats() { - ::memset(&_stats, 0, sizeof(_stats)); - } -}; - -class BFudptransmit_impl { - UDPTransmitThread _transmit; - ProcLog _type_log; - ProcLog _bind_log; - ProcLog _stat_log; - pid_t _pid; - - void update_stats_log() { - const PacketStats* stats = _transmit.get_stats(); - _stat_log.update() << "ngood_bytes : " << stats->nvalid_bytes << "\n" - << "nmissing_bytes : " << stats->ninvalid_bytes << "\n" - << "ninvalid : " << stats->ninvalid << "\n" - << "ninvalid_bytes : " << stats->ninvalid_bytes << "\n" - << "nlate : " << stats->nlate << "\n" - << "nlate_bytes : " << stats->nlate_bytes << "\n" - << "nvalid : " << stats->nvalid << "\n" - << "nvalid_bytes : " << stats->nvalid_bytes << "\n"; - } -public: - inline BFudptransmit_impl(int fd, - int core) - : _transmit(fd, core), - _type_log("udp_transmit/type"), - _bind_log("udp_transmit/bind"), - _stat_log("udp_transmit/stats") { - _type_log.update() << "type : " << "generic"; - _bind_log.update() << "ncore : " << 1 << "\n" - << "core0 : " << core << "\n"; - } - BFudptransmit_status send(char *packet, unsigned int len) { - ssize_t state; - struct msghdr msg; - struct iovec iov[1]; - - memset(&msg, 0, sizeof(msg)); - msg.msg_iov = iov; - msg.msg_iovlen = 1; - iov[0].iov_base = packet; - iov[0].iov_len = len; - - state = _transmit.send( &msg ); - if( state == -1 ) { - return BF_TRANSMIT_ERROR; - } - this->update_stats_log(); - return BF_TRANSMIT_CONTINUED; - } - BFudptransmit_status sendmany(char *packets, unsigned int len, unsigned int npackets) { - ssize_t state; - unsigned int i; - struct mmsghdr *mmsg = NULL; - struct iovec *iovs = NULL; - - mmsg = (struct mmsghdr *) malloc(sizeof(struct mmsghdr)*npackets); - iovs = (struct iovec *) malloc(sizeof(struct iovec)*npackets); - memset(mmsg, 0, sizeof(struct mmsghdr)*npackets); - for(i=0; iupdate_stats_log(); - return BF_TRANSMIT_CONTINUED; - } -}; - -BFstatus bfUdpTransmitCreate(BFudptransmit* obj, - int fd, - int core) { - BF_ASSERT(obj, BF_STATUS_INVALID_POINTER); - BF_TRY_RETURN_ELSE(*obj = new BFudptransmit_impl(fd, core), - *obj = 0); - -} -BFstatus bfUdpTransmitDestroy(BFudptransmit obj) { - BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); - delete obj; - return BF_STATUS_SUCCESS; -} -BFstatus bfUdpTransmitSend(BFudptransmit obj, char* packet, unsigned int len) { - BF_TRY_RETURN(obj->send(packet, len)); -} -BFstatus bfUdpTransmitSendMany(BFudptransmit obj, char* packets, unsigned int len, unsigned int npackets) { - BF_ASSERT(obj, BF_STATUS_INVALID_HANDLE); - BF_TRY_RETURN(obj->sendmany(packets, len, npackets)); -} diff --git a/src/unpack.cpp b/src/unpack.cpp index 7266bd3f3..6095c185b 100644 --- a/src/unpack.cpp +++ b/src/unpack.cpp @@ -29,7 +29,7 @@ #include #include "utils.hpp" -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED #include "cuda.hpp" #include "trace.hpp" #include @@ -264,7 +264,7 @@ BFstatus bfUnpack(BFarray const* in, BF_ASSERT(is_contiguous(in), BF_STATUS_UNSUPPORTED_STRIDE); BF_ASSERT(is_contiguous(out), BF_STATUS_UNSUPPORTED_STRIDE); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED BF_ASSERT(space_accessible_from(in->space, BF_SPACE_SYSTEM) || (space_accessible_from(in->space, BF_SPACE_CUDA) && space_accessible_from(out->space, BF_SPACE_CUDA)), BF_STATUS_UNSUPPORTED_SPACE); BF_ASSERT(space_accessible_from(out->space, BF_SPACE_SYSTEM) || (space_accessible_from(in->space, BF_SPACE_CUDA) && space_accessible_from(out->space, BF_SPACE_CUDA)), @@ -280,7 +280,7 @@ BFstatus bfUnpack(BFarray const* in, bool byteswap = ( in->big_endian != is_big_endian()); bool conjugate = (in->conjugated != out->conjugated); -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { BF_ASSERT(nelement<=(size_t)512*65535*65535, BF_STATUS_UNSUPPORTED_SHAPE); } @@ -305,7 +305,7 @@ BFstatus bfUnpack(BFarray const* in, align_msb, \ conjugate)) -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED #define CALL_FOREACH_SIMPLE_GPU_UNPACK(itype,otype) \ { \ BF_TRACE(); \ @@ -343,7 +343,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I1: { BF_ASSERT(nelement % 8 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 8; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_UNPACK(uint8_t,int64_t); } else { @@ -358,7 +358,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I2: { BF_ASSERT(nelement % 4 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 4; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_UNPACK(uint8_t,int32_t); } else { @@ -373,7 +373,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I4: { BF_ASSERT(nelement % 2 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 2; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_UNPACK(uint8_t,int16_t); } else { @@ -390,7 +390,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_U2: { BF_ASSERT(nelement % 4 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 4; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_UNPACK(uint8_t,uint32_t); } else { @@ -404,7 +404,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_U4: { BF_ASSERT(nelement % 2 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 2; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_SIMPLE_GPU_UNPACK(uint8_t,uint16_t); } else { @@ -426,7 +426,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I1: { BF_ASSERT(nelement % 8 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 8; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_PROMOTE_GPU_UNPACK(uint8_t,int64_t,float); } else { @@ -441,7 +441,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I2: { BF_ASSERT(nelement % 4 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 4; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_PROMOTE_GPU_UNPACK(uint8_t,int32_t,float); } else { @@ -456,7 +456,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I4: { BF_ASSERT(nelement % 2 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 2; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_PROMOTE_GPU_UNPACK(uint8_t,int16_t,float); } else { @@ -478,7 +478,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I1: { BF_ASSERT(nelement % 8 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 8; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_PROMOTE_GPU_UNPACK(uint8_t,int64_t,double); } else { @@ -492,7 +492,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I2: { BF_ASSERT(nelement % 4 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 4; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_PROMOTE_GPU_UNPACK(uint8_t,int32_t,double); } else { @@ -507,7 +507,7 @@ BFstatus bfUnpack(BFarray const* in, case BF_DTYPE_I4: { BF_ASSERT(nelement % 2 == 0, BF_STATUS_INVALID_SHAPE); nelement /= 2; -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED if( space_accessible_from(in->space, BF_SPACE_CUDA) ) { CALL_FOREACH_PROMOTE_GPU_UNPACK(uint8_t,int16_t,double); } else { @@ -526,7 +526,7 @@ BFstatus bfUnpack(BFarray const* in, } #undef CALL_FOREACH_SIMPLE_CPU_UNPACK #undef CALL_FOREACH_PROMOTE_CPU_UNPACK -#ifdef BF_CUDA_ENABLED +#if BF_CUDA_ENABLED #undef CALL_FOREACH_SIMPLE_GPU_UNPACK #undef CALL_FOREACH_PROMOTE_GPU_UNPACK #endif diff --git a/src/utils.hpp b/src/utils.hpp index 710e3488b..32219dcd0 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -29,6 +29,7 @@ #pragma once +#include #include #include #include @@ -38,6 +39,7 @@ #include #include #include // For ::memcpy +#include #include #define BF_DTYPE_IS_COMPLEX(dtype) bool((dtype) & BF_DTYPE_COMPLEX_BIT) @@ -217,6 +219,12 @@ inline BFbool space_accessible_from(BFspace space, BFspace from) { space == BF_SPACE_CUDA_MANAGED); case BF_SPACE_CUDA: return (space == BF_SPACE_CUDA || space == BF_SPACE_CUDA_MANAGED); +#if BF_GPU_MANAGEDMEM + case BF_SPACE_CUDA_MANAGED: return (space == BF_SPACE_SYSTEM || + space == BF_SPACE_CUDA_HOST || + space == BF_SPACE_CUDA_MANAGED || + space == BF_SPACE_CUDA); +#endif // TODO: Need to use something else here? default: throw std::runtime_error("Internal error"); } diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/__init__.py @@ -0,0 +1 @@ + diff --git a/test/download_test_data.sh b/test/download_test_data.sh index 9ae9fbbc3..3424d9d23 100755 --- a/test/download_test_data.sh +++ b/test/download_test_data.sh @@ -3,4 +3,3 @@ curl -L -O https://fornax.phys.unm.edu/lwa/data/bf_test_files.tar.gz tar xzf bf_test_files.tar.gz mv for_test_suite data rm bf_test_files.tar.gz - diff --git a/test/jenkins.sh b/test/jenkins.sh deleted file mode 100755 index 2bd52f4b2..000000000 --- a/test/jenkins.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# This file runs CPU and GPU tests for jenkins -./download_test_data.sh -export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} -python -c "from bifrost import telemetry; telemetry.disable()" -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline -m unittest \ - test_block \ - test_sigproc \ - test_resizing \ - test_quantize \ - test_unpack \ - test_print_header \ - test_pipeline_cpu \ - test_serialize \ - test_binary_io \ - test_address \ - test_fdmt \ - test_fft \ - test_fir \ - test_guantize \ - test_gunpack \ - test_linalg \ - test_map \ - test_reduce \ - test_romein \ - test_scrunch \ - test_transpose diff --git a/test/test_accumulate.py b/test/test_accumulate.py index a70235ef5..c4107381d 100644 --- a/test/test_accumulate.py +++ b/test/test_accumulate.py @@ -32,6 +32,8 @@ import bifrost.pipeline as bfp import bifrost.blocks as blocks +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + class CallbackBlock(blocks.CopyBlock): """Testing-only block which calls user-defined @@ -47,6 +49,7 @@ def on_data(self, ispan, ospan): self.data_callback(ispan, ospan) return super(CallbackBlock, self).on_data(ispan, ospan) +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TestAccumulateBlock(unittest.TestCase): def setUp(self): """Create settings shared between tests""" diff --git a/test/test_binary_io.py b/test/test_binary_io.py index ddc117627..128217ee1 100644 --- a/test/test_binary_io.py +++ b/test/test_binary_io.py @@ -25,6 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import unittest +import os import bifrost as bf import numpy as np from bifrost import blocks @@ -97,3 +98,10 @@ def data_callback(ispan, ospan): callback = CallbackBlock(b_read, seq_callback, data_callback) pipeline.run() + def tearDown(self): + for filename in self.filenames: + os.unlink(filename) + try: + os.unlink(filename+".out") + except OSError: + pass \ No newline at end of file diff --git a/test/test_block.py b/test/test_block.py index a27fea44d..4f49539c4 100644 --- a/test/test_block.py +++ b/test/test_block.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -69,7 +69,8 @@ def test_multi_dimensional_input(self): self.blocks.append((TestingBlock(test_array), [], [0])) self.blocks.append((WriteHeaderBlock('.log2.txt'), [0], [])) Pipeline(self.blocks).main() - header = eval(open('.log2.txt').read()) # pylint:disable=eval-used + with open('.log2.txt') as fh: + header = eval(fh.read()) # pylint:disable=eval-used dumped_numbers = np.loadtxt('.log.txt').reshape(header['shape']) np.testing.assert_almost_equal(dumped_numbers, test_array) class TestCopyBlock(unittest.TestCase): @@ -90,7 +91,8 @@ def test_simple_copy(self): self.blocks.append((CopyBlock(), [0], [1])) self.blocks.append((WriteAsciiBlock(logfile), [1], [])) Pipeline(self.blocks).main() - test_byte = open(logfile, 'r').read(1) + with open(logfile, 'r') as fh: + test_byte = fh.read(1) self.assertEqual(test_byte, '2') def test_multi_copy(self): """Test which performs a read of a sigproc file, @@ -102,7 +104,8 @@ def test_multi_copy(self): (CopyBlock(), [i], [i + 1])) self.blocks.append((WriteAsciiBlock(logfile), [10], [])) Pipeline(self.blocks).main() - test_byte = open(logfile, 'r').read(1) + with open(logfile, 'r') as fh: + test_byte = fh.read(1) self.assertEqual(test_byte, '2') def test_non_linear_multi_copy(self): """Test which reads in a sigproc file, and @@ -117,8 +120,9 @@ def test_non_linear_multi_copy(self): self.blocks.append((CopyBlock(), [5], [6])) self.blocks.append((WriteAsciiBlock(logfile), [6], [])) Pipeline(self.blocks).main() - log_nums = open(logfile, 'r').read(500).split(' ') - test_num = np.float(log_nums[8]) + with open(logfile, 'r') as fh: + log_nums = fh.read(500).split(' ') + test_num = float(log_nums[8]) self.assertEqual(test_num, 3) def test_single_block_multi_copy(self): """Test which forces one block to do multiple @@ -129,9 +133,9 @@ def test_single_block_multi_copy(self): self.blocks.append((WriteAsciiBlock(logfiles[0]), [1], [])) self.blocks.append((WriteAsciiBlock(logfiles[1]), [2], [])) Pipeline(self.blocks).main() - test_bytes = int( - open(logfiles[0], 'r').read(1)) + int( - open(logfiles[1], 'r').read(1)) + with open(logfiles[0], 'r') as fh0: + with open(logfiles[1], 'r') as fh1: + test_bytes = int(fh0.read(1)) + int(fh1.read(1)) self.assertEqual(test_bytes, 4) def test_32bit_copy(self): """Perform a simple test to confirm that 32 bit @@ -145,8 +149,9 @@ def test_32bit_copy(self): self.blocks.append((CopyBlock(), [0], [1])) self.blocks.append((WriteAsciiBlock(logfile), [1], [])) Pipeline(self.blocks).main() - test_bytes = open(logfile, 'r').read(500).split(' ') - self.assertAlmostEqual(np.float(test_bytes[0]), 0.72650784254) + with open(logfile, 'r') as fh: + test_bytes = fh.read(500).split(' ') + self.assertAlmostEqual(float(test_bytes[0]), 0.72650784254) class TestFoldBlock(unittest.TestCase): """This tests functionality of the FoldBlock.""" def setUp(self): @@ -163,8 +168,9 @@ def dump_ring_and_read(self): logfile = ".log.txt" self.blocks.append((WriteAsciiBlock(logfile), [1], [])) Pipeline(self.blocks).main() - test_bytes = open(logfile, 'r').read().split(' ') - histogram = np.array([np.float(x) for x in test_bytes]) + with open(logfile, 'r') as fh: + test_bytes = fh.read().split(' ') + histogram = np.array([float(x) for x in test_bytes]) return histogram def test_simple_pulsar(self): """Test whether a pulsar histogram @@ -234,7 +240,8 @@ def test_data_throughput(self): blocks.append(( WriteAsciiBlock('.log.txt'), [1], [])) Pipeline(blocks).main() - test_byte = open('.log.txt', 'r').read().split(' ') + with open('.log.txt', 'r') as fh: + test_byte = fh.read().split(' ') test_nums = np.array([float(x) for x in test_byte]) self.assertLess(np.max(test_nums), 256) self.assertEqual(test_nums.size, 12800) @@ -253,12 +260,14 @@ def setUp(self): def test_throughput(self): """Test that any data is being put through""" Pipeline(self.blocks).main() - test_string = open(self.logfile, 'r').read() + with open(self.logfile, 'r') as fh: + test_string = fh.read() self.assertGreater(len(test_string), 0) def test_throughput_size(self): """Number of elements going out should be double that of basic copy""" Pipeline(self.blocks).main() - number_fftd = len(open(self.logfile, 'r').read().split('\n')) + with open(self.logfile, 'r') as fh: + number_fftd = len(fh.read().split('\n')) number_fftd = np.loadtxt(self.logfile).size open(self.logfile, 'w').close() # Run pipeline again with simple copy @@ -467,11 +476,11 @@ def monitor_block_sequences(array): if self.i > 1 and self.i < 11: with self.monitor_block.rings['out_1'].open_latest_sequence(guarantee=False) as curr_seq: span_gen = curr_seq.read(1) - self.all_sequence_starts.append(int(next(span_gen).data[0])) + self.all_sequence_starts.append(int(next(span_gen).data[0][0])) if self.i > 12: with self.monitor_block.rings['out_1'].open_latest_sequence(guarantee=False) as curr_seq: span_gen = curr_seq.read(1) - self.all_sequence_starts.append(int(next(span_gen).data[0])) + self.all_sequence_starts.append(int(next(span_gen).data[0][0])) self.i += 1 return array diff --git a/test/test_disk_io.py b/test/test_disk_io.py new file mode 100644 index 000000000..2c1ca6aed --- /dev/null +++ b/test/test_disk_io.py @@ -0,0 +1,615 @@ +# Copyright (c) 2019-2024, The Bifrost Authors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import unittest +import os +import json +import ctypes +import threading +import bifrost as bf +from bifrost.ring import Ring +from bifrost.packet_writer import HeaderInfo, DiskWriter +from bifrost.packet_capture import PacketCaptureCallback, DiskReader +from bifrost.quantize import quantize +from bifrost.pipeline import SourceBlock, SinkBlock +import datetime +import numpy as np + +class AccumulateOp(object): + def __init__(self, ring, output_timetags, output_data, size, dtype=np.uint8): + self.ring = ring + self.output_timetags = output_timetags + self.output_data = output_data + self.size = size*(dtype().nbytes) + self.dtype = dtype + + def main(self): + for iseq in self.ring.read(guarantee=True): + self.output_timetags.append(iseq.time_tag) + self.output_data.append([]) + + iseq_spans = iseq.read(self.size) + while not self.ring.writing_ended(): + for ispan in iseq_spans: + idata = ispan.data_view(self.dtype) + self.output_data[-1].append(idata.copy()) + +class BaseDiskIOTest(object): + class BaseDiskIOTestCase(unittest.TestCase): + def setUp(self): + """Generate some dummy data to read""" + # Generate test vector and save to file + t = np.arange(256*4096*2) + w = 0.2 + self.s0 = 5*np.cos(w * t, dtype='float32') \ + + 3j*np.sin(w * t, dtype='float32') + # Filename cache so we can cleanup later + self._cache = [] + def _open(self, filename, mode): + fh = open(filename, mode) + if filename not in self._cache: + self._cache.append(filename) + return fh + def tearDown(self): + for filename in self._cache: + os.unlink(filename) + + +class TBNReader(object): + def __init__(self, sock, ring, nsrc=32): + self.sock = sock + self.ring = ring + self.nsrc = nsrc + def callback(self, seq0, time_tag, decim, chan0, nsrc, hdr_ptr, hdr_size_ptr): + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'cfreq': 196e6 * chan0/2.**32, + 'bw': 196e6/decim, + 'nstand': nsrc/2, + 'npol': 2, + 'complex': True, + 'nbit': 8} + try: + hdr_str = json.dumps(hdr).encode() + except AttributeError: + # Python2 catch + pass + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_tbn(self.callback) + with DiskReader("tbn", self.sock, self.ring, self.nsrc, 0, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class TBNDiskIOTest(BaseDiskIOTest.BaseDiskIOTestCase): + """Test simple IO for the disk-based TBN packet reader and writing""" + def _get_data(self): + # Setup the packet HeaderInfo + hdr_desc = HeaderInfo() + hdr_desc.set_tuning(int(round(74e6 / 196e6 * 2**32))) + hdr_desc.set_gain(20) + + # Reorder as packets, stands, time + data = self.s0.reshape(512,32,-1) + data = data.transpose(2,1,0).copy() + # Convert to ci8 for TBN + data_q = bf.ndarray(shape=data.shape, dtype='ci8') + quantize(data, data_q, scale=10) + + # Update the number of data sources and return + hdr_desc.set_nsrc(data_q.shape[1]) + return 1, hdr_desc, data_q + def test_write(self): + fh = self._open('test_tbn.dat', 'wb') + oop = DiskWriter('tbn', fh) + + # Get TBN data + timetag0, hdr_desc, data = self._get_data() + + # Go! + oop.send(hdr_desc, timetag0, 1960*512, 0, 1, data) + fh.close() + + self.assertEqual(os.path.getsize('test_tbn.dat'), \ + 1048*data.shape[0]*data.shape[1]) + def test_read(self): + # Write + fh = self._open('test_tbn.dat', 'wb') + oop = DiskWriter('tbn', fh) + + # Get TBN data + timetag0, hdr_desc, data = self._get_data() + + # Go! + oop.send(hdr_desc, timetag0, 1960*512, 0, 1, data) + fh.close() + + # Read + fh = self._open('test_tbn.dat', 'rb') + ring = Ring(name="capture_tbn") + iop = TBNReader(fh, ring, nsrc=32) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 32*512*2) + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get TBN data + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Loop over sequences + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,512,32,2) + seq_data = seq_data.transpose(0,2,1,3).copy() + ## Drop the last axis (complexity) since we are going to ci8 + seq_data = bf.ndarray(shape=seq_data.shape[:-1], dtype='ci8', buffer=seq_data.ctypes.data) + + ## Ignore the first set of packets + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + fh.close() + + +class DRXReader(object): + def __init__(self, sock, ring, nsrc=4): + self.sock = sock + self.ring = ring + self.nsrc = nsrc + def callback(self, seq0, time_tag, decim, chan0, chan1, nsrc, hdr_ptr, hdr_size_ptr): + #print "++++++++++++++++ seq0 =", seq0 + #print " time_tag =", time_tag + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'chan1': chan1, + 'cfreq0': 196e6 * chan0/2.**32, + 'cfreq1': 196e6 * chan1/2.**32, + 'bw': 196e6/decim, + 'nstand': nsrc/2, + 'npol': 2, + 'complex': True, + 'nbit': 4} + #print "******** CFREQ:", hdr['cfreq'] + try: + hdr_str = json.dumps(hdr).encode() + except AttributeError: + # Python2 catch + pass + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_drx(self.callback) + with DiskReader("drx", self.sock, self.ring, self.nsrc, 0, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class DRXDiskIOTest(BaseDiskIOTest.BaseDiskIOTestCase): + """Test simple IO for the disk-based DRX packet reader and writing""" + def _get_data(self): + # Setup the packet HeaderInfo + hdr_desc = HeaderInfo() + hdr_desc.set_decimation(10) + hdr_desc.set_tuning(int(round(74e6 / 196e6 * 2**32))) + + # Reorder as packets, beams, time + data = self.s0.reshape(4096,4,-1) + data = data.transpose(2,1,0).copy() + # Convert to ci4 for DRX + data_q = bf.ndarray(shape=data.shape, dtype='ci4') + quantize(data, data_q) + + # Update the number of data sources and return + hdr_desc.set_nsrc(data_q.shape[1]) + return 1, hdr_desc, data_q + def test_write(self): + fh = self._open('test_drx.dat', 'wb') + oop = DiskWriter('drx', fh) + + # Get DRX data + timetag0, hdr_desc, data = self._get_data() + + # Go! + oop.send(hdr_desc, timetag0, 10*4096, (1<<3), 128, data) + fh.close() + + self.assertEqual(os.path.getsize('test_drx.dat'), \ + 4128*data.shape[0]*data.shape[1]) + def test_read(self): + # Write + fh = self._open('test_drx.dat', 'wb') + oop = DiskWriter('drx', fh) + + # Get DRX data and write it out + timetag0, hdr_desc, data = self._get_data() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*10*4096, 10*4096, (1<<3), 128, data[p,[0,1],...].reshape(1,2,4096)) + oop.send(hdr_desc, timetag0+p*10*4096, 10*4096, (2<<3), 128, data[p,[2,3],...].reshape(1,2,4096)) + fh.close() + + # Read + fh = self._open('test_drx.dat', 'rb') + ring = Ring(name="capture_drx") + iop = DRXReader(fh, ring, nsrc=4) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 4*4096*1) + + # Start the reader + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get DRX data + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Reorder to match what we sent out + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,4096,4) + seq_data = seq_data.transpose(0,2,1).copy() + seq_data = bf.ndarray(shape=seq_data.shape, dtype='ci4', buffer=seq_data.ctypes.data) + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + fh.close() + def test_write_single(self): + fh = self._open('test_drx_single.dat', 'wb') + oop = DiskWriter('drx', fh) + + # Get DRX data + timetag0, hdr_desc, data = self._get_data() + hdr_desc.set_nsrc(2) + data = data[:,[0,1],:].copy() + + # Go! + oop.send(hdr_desc, timetag0, 10*4096, (1<<3), 128, data) + fh.close() + + self.assertEqual(os.path.getsize('test_drx_single.dat'), \ + 4128*data.shape[0]*data.shape[1]) + def test_read_single(self): + # Write + fh = self._open('test_drx_single.dat', 'wb') + oop = DiskWriter('drx', fh) + + # Get DRX data and write it out + timetag0, hdr_desc, data = self._get_data() + hdr_desc.set_nsrc(2) + data = data[:,[0,1],:].copy() + oop.send(hdr_desc, timetag0, 10*4096, (1<<3), 128, data) + fh.close() + + # Read + fh = self._open('test_drx_single.dat', 'rb') + ring = Ring(name="capture_drx_single") + iop = DRXReader(fh, ring, nsrc=2) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 2*4096*1) + + # Start the reader + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get DRX data + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Reorder to match what we sent out + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,4096,2) + seq_data = seq_data.transpose(0,2,1).copy() + seq_data = bf.ndarray(shape=seq_data.shape, dtype='ci4', buffer=seq_data.ctypes.data) + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + fh.close() + + +class PBeamReader(object): + def __init__(self, sock, ring, nchan, nsrc=1): + self.sock = sock + self.ring = ring + self.nchan = nchan + self.nsrc = nsrc + def callback(self, seq0, time_tag, navg, chan0, nchan, nbeam, hdr_ptr, hdr_size_ptr): + #print "++++++++++++++++ seq0 =", seq0 + #print " time_tag =", time_tag + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'cfreq0': chan0*(196e6/8192), + 'bw': nchan*(196e6/8192), + 'navg': navg, + 'nbeam': nbeam, + 'npol': 4, + 'complex': False, + 'nbit': 32} + #print("******** HDR:", hdr) + try: + hdr_str = json.dumps(hdr).encode() + except AttributeError: + # Python2 catch + pass + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_pbeam(self.callback) + with DiskReader("pbeam_%i" % self.nchan, self.sock, self.ring, self.nsrc, 1, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class PBeamDiskIOTest(BaseDiskIOTest.BaseDiskIOTestCase): + """Test simple IO for the disk-based PBeam packet reader and writing""" + def _get_data(self): + # Setup the packet HeaderInfo + hdr_desc = HeaderInfo() + hdr_desc.set_tuning(2) + hdr_desc.set_chan0(1034) + hdr_desc.set_nchan(128) + hdr_desc.set_decimation(24) + + # Reorder as packets, beam, chan/pol + data = self.s0.reshape(128*4,1,-1) + data = data.transpose(2,1,0) + data = data.real[:1024,...].copy() + + # Update the number of data sources and return + hdr_desc.set_nsrc(data.shape[1]) + return 1, hdr_desc, data + def test_write(self): + fh = self._open('test_pbeam.dat', 'wb') + oop = DiskWriter('pbeam1_128', fh) + + # Get PBeam data + timetag0, hdr_desc, data = self._get_data() + + # Go! + oop.send(hdr_desc, timetag0, 24, 0, 1, data) + fh.close() + + self.assertEqual(os.path.getsize('test_pbeam.dat'), \ + (18+128*4*4)*data.shape[0]*data.shape[1]) + def test_read(self): + # Write + fh = self._open('test_pbeam.dat', 'wb') + oop = DiskWriter('pbeam1_128', fh) + + # Get PBeam data + timetag0, hdr_desc, data = self._get_data() + + # Go! + oop.send(hdr_desc, timetag0, 24, 0, 1, data) + fh.close() + + # Read + fh = self._open('test_pbeam.dat', 'rb') + ring = Ring(name="capture_pbeam") + iop = PBeamReader(fh, ring, 128, nsrc=1) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 1*128*4, dtype=np.float32) + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get PBeam data + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Reorder to match what we sent out + seq_data = np.array(seq_data, dtype=np.float32) + seq_data = seq_data.reshape(-1,128*4,1) + seq_data = seq_data.transpose(0,2,1).copy() + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + fh.close() + + +start_pipeline = datetime.datetime.now() + +class SIMPLEReader(object): + def __init__(self, sock, ring): + self.sock = sock + self.ring = ring + self.nsrc = 1 + def seq_callback(self, seq0, chan0, nchan, nsrc, + time_tag_ptr, hdr_ptr, hdr_size_ptr): + FS = 196.0e6 + CHAN_BW = 1e3 + # timestamp0 = (self.utc_start - ADP_EPOCH).total_seconds() + # time_tag0 = timestamp0 * int(FS) + time_tag = int((datetime.datetime.now() - start_pipeline).total_seconds()*1e6) + time_tag_ptr[0] = time_tag + cfreq = 55e6 + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'nchan': nchan, + 'cfreq': cfreq, + 'bw': CHAN_BW, + 'nstand': 1, + #'stand0': src0*16, # TODO: Pass src0 to the callback too(?) + 'npol': 1, + 'complex': True, + 'nbit': 16} + hdr_str = json.dumps(hdr).encode() + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + self.header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(self.header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_simple(self.seq_callback) + with DiskReader("simple" , self.sock, self.ring, self.nsrc, 0, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class SimpleDiskIOTest(BaseDiskIOTest.BaseDiskIOTestCase): + """Test simple IO for the disk-based Simple packet reader and writing""" + def _get_simple_data(self): + hdr_desc = HeaderInfo() + + # Reorder as packets, stands, time + data = self.s0.reshape(2048,1,-1) + data = data.transpose(2,1,0).copy() + # Convert to ci16 for simple + data_q = bf.ndarray(shape=data.shape, dtype='ci16') + quantize(data, data_q, scale=10) + + return 128, hdr_desc, data_q + + def test_write_simple(self): + fh = self._open('test_simple.dat','wb') + oop = DiskWriter('simple', fh) + timetag0, hdr_desc, data = self._get_simple_data() + oop.send(hdr_desc, timetag0, 1, 0, 1, data) + fh.close() + + nelements = 2048 + byteperelem = 4 + bytehdrperelem = 8 + npackets = 1024 + expectedsize = (2048*4 + 8)*1024 + self.assertEqual(os.path.getsize('test_simple.dat'), \ + expectedsize) + + def test_read_simple(self): + # Write + fh = self._open('test_simple.dat', 'wb') + oop = DiskWriter('simple', fh) + + # Get data + timetag0, hdr_desc, data = self._get_simple_data() + + # Go! + oop.send(hdr_desc, timetag0, 1, 0, 1, data) + fh.close() + + # Read + + fh = self._open('test_simple.dat', 'rb') + ring = Ring(name="capture_simple") + iop = SIMPLEReader(fh, ring) + ## Data accumulation + times = [] + final = [] + expectedsize = 1*2048*4 + aop = AccumulateOp(ring, times, final, expectedsize, dtype=np.uint16) + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get simple data + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + seq_data = np.array(seq_data, dtype=np.uint16) + seq_data = seq_data.reshape(-1,2048,1,2) + seq_data = seq_data.transpose(0,2,1,3).copy() + ## Drop the last axis (complexity) since we are going to ci16 + seq_data = bf.ndarray(shape=seq_data.shape[:-1], dtype='ci16', buffer=seq_data.ctypes.data) + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + del oop + fh.close() diff --git a/test/test_fdmt.py b/test/test_fdmt.py index 04ae40398..844e7fe01 100644 --- a/test/test_fdmt.py +++ b/test/test_fdmt.py @@ -30,6 +30,9 @@ import bifrost as bf from bifrost.fdmt import Fdmt +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class FdmtTest(unittest.TestCase): def run_test(self, ntime, nchan, max_delay, batch_shape=()): fdmt = Fdmt() diff --git a/test/test_fft.py b/test/test_fft.py index 4858c6703..afaeaa068 100644 --- a/test/test_fft.py +++ b/test/test_fft.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -37,6 +37,8 @@ from bifrost.fft import Fft import bifrost as bf +from bifrost.libbifrost_generated import BF_CUDA_ENABLED, BF_CUDA_VERSION + MTOL = 1e-6 # Relative tolerance at the mean magnitude RTOL = 1e-1 @@ -48,6 +50,7 @@ def compare(result, gold): absmean = np.abs(gold).mean() np.testing.assert_allclose(result, gold, rtol=RTOL, atol=MTOL * absmean) +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TestFFT(unittest.TestCase): def setUp(self): np.random.seed(1234) @@ -113,22 +116,24 @@ def run_test_r2c(self, shape, axes, dtype=np.float32): self.run_test_r2c_dtype(shape, axes, np.int16, (1 << 15) - 1, misalign=misalign) for misalign in range(8): self.run_test_r2c_dtype(shape, axes, np.int8, (1 << 7 ) - 1, misalign=misalign) - def run_test_c2r_impl(self, shape, axes, fftshift=False): + def run_test_c2r_impl(self, shape, axes): ishape = list(shape) oshape = list(shape) ishape[axes[-1]] = shape[axes[-1]] // 2 + 1 oshape[axes[-1]] = (ishape[axes[-1]] - 1) * 2 ishape[-1] *= 2 # For complex - known_data = np.random.normal(size=ishape).astype(np.float32).view(np.complex64) + # Note: We need to make a set of known_data that are consistent with a + # a real real-to-complex FFT. + known_data_real = np.random.normal(size=oshape).astype(np.float32) + known_data = gold_rfftn(known_data_real, axes=axes) + known_data = known_data.copy().astype(np.complex64) idata = bf.ndarray(known_data, space='cuda') odata = bf.ndarray(shape=oshape, dtype='f32', space='cuda') fft = Fft() - fft.init(idata, odata, axes=axes, apply_fftshift=fftshift) + fft.init(idata, odata, axes=axes) fft.execute(idata, odata) # Note: Numpy applies normalization while CUFFT does not norm = reduce(lambda a, b: a * b, [shape[d] for d in axes]) - if fftshift: - known_data = np.fft.ifftshift(known_data, axes=axes) known_result = gold_irfftn(known_data, axes=axes) * norm compare(odata.copy('system'), known_result) def run_test_c2c(self, shape, axes): @@ -138,7 +143,6 @@ def run_test_c2c(self, shape, axes): self.run_test_c2c_impl(shape, axes, inverse=True, fftshift=True) def run_test_c2r(self, shape, axes): self.run_test_c2r_impl(shape, axes) - self.run_test_c2r_impl(shape, axes, fftshift=True) def test_1D(self): self.run_test_c2c(self.shape1D, [0]) diff --git a/test/test_fir.py b/test/test_fir.py index bcfa0d42d..596158a5a 100644 --- a/test/test_fir.py +++ b/test/test_fir.py @@ -1,6 +1,6 @@ -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2020, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,8 +28,6 @@ """This set of unit tests check the functionality on the bifrost FIR filter.""" -# Python2 compatibility -from __future__ import division import ctypes import unittest @@ -38,6 +36,8 @@ from bifrost.fir import Fir import bifrost as bf +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + MTOL = 1e-6 # Relative tolerance at the mean magnitude RTOL = 1e-1 @@ -49,6 +49,7 @@ def compare(result, gold): absmean = np.abs(gold).mean() np.testing.assert_allclose(result, gold, rtol=RTOL, atol=MTOL * absmean) +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TestFIR(unittest.TestCase): def setUp(self): np.random.seed(1234) diff --git a/test/test_guantize.py b/test/test_guantize.py index 4c8a618b2..f642e40bc 100644 --- a/test/test_guantize.py +++ b/test/test_guantize.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -30,6 +30,9 @@ import bifrost as bf import bifrost.quantize +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class QuantizeTest(unittest.TestCase): def run_quantize_from_cf32_test(self, out_dtype): iarray = bf.ndarray([[0.4 + 0.5j, 1.4 + 1.5j], @@ -41,7 +44,7 @@ def run_quantize_from_cf32_test(self, out_dtype): [(2,2), (3,4)], [(4,4), (5,6)]], dtype=out_dtype) - bf.quantize.quantize(iarray.copy(space='cuda'), oarray) + bf.quantize(iarray.copy(space='cuda'), oarray) oarray = oarray.copy(space='system') np.testing.assert_equal(oarray, oarray_known) def test_cf32_to_ci8(self): diff --git a/test/test_gunpack.py b/test/test_gunpack.py index 94ced4409..38a00621c 100644 --- a/test/test_gunpack.py +++ b/test/test_gunpack.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -30,6 +30,9 @@ import bifrost as bf import bifrost.unpack +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class UnpackTest(unittest.TestCase): def run_unpack_to_ci8_test(self, iarray): oarray = bf.ndarray(shape=iarray.shape, dtype='ci8', space='cuda') @@ -37,7 +40,7 @@ def run_unpack_to_ci8_test(self, iarray): [(4, 5), (6, 7)], [(-8, -7), (-6, -5)]], dtype='ci8') - bf.unpack.unpack(iarray.copy(space='cuda'), oarray) + bf.unpack(iarray.copy(space='cuda'), oarray) oarray = oarray.copy(space='system') np.testing.assert_equal(oarray, oarray_known) def test_ci4_to_ci8(self): @@ -71,7 +74,7 @@ def run_unpack_to_cf32_test(self, iarray): [ 4+5j, 6+7j], [-8-7j, -6-5j]], dtype='cf32') - bf.unpack.unpack(iarray.copy(space='cuda'), oarray) + bf.unpack(iarray.copy(space='cuda'), oarray) oarray = oarray.copy(space='system') np.testing.assert_equal(oarray, oarray_known) def test_ci4_to_cf32(self): @@ -97,4 +100,4 @@ def test_ci4_to_cf32_byteswap_conjugate(self): [(0x4B,),(0x69,)], [(0x87,),(0xA5,)]], dtype='ci4') - self.run_unpack_to_cf32_test(iarray.byteswap().conj()) \ No newline at end of file + self.run_unpack_to_cf32_test(iarray.byteswap().conj()) diff --git a/test/test_header_standard.py b/test/test_header_standard.py index d5288f512..90e015155 100644 --- a/test/test_header_standard.py +++ b/test/test_header_standard.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -48,9 +48,9 @@ def test_simple_header(self): def test_numpy_types(self): """Same values, but some are numpy types""" self.header_dict = { - 'nchans': np.int(1), 'nifs': 1, 'nbits': 8, - 'fch1': np.float(100.0), 'foff': np.float(1e-5), - 'tstart': 1e5, 'tsamp': np.float(1e-5)} + 'nchans': np.int64(1), 'nifs': 1, 'nbits': 8, + 'fch1': np.float64(100.0), 'foff': np.float64(1e-5), + 'tstart': 1e5, 'tsamp': np.float64(1e-5)} def test_extra_parameters(self): """Add some extra parameters""" self.header_dict = { diff --git a/test/test_interop.py b/test/test_interop.py new file mode 100644 index 000000000..d3f26dc35 --- /dev/null +++ b/test/test_interop.py @@ -0,0 +1,133 @@ + +# Copyright (c) 2022, The Bifrost Authors. All rights reserved. +# Copyright (c) 2022, The University of New Mexico. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import unittest +import numpy as np +import bifrost as bf + +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + +try: + import cupy as cp + HAVE_CUPY = True +except ImportError: + HAVE_CUPY = False + +try: + import pycuda.driver as cuda + import pycuda.autoinit + import pycuda.gpuarray + import pycuda.driver + HAVE_PYCUDA = True +except ImportError: + HAVE_PYCUDA = False + +@unittest.skipUnless(BF_CUDA_ENABLED and HAVE_CUPY, "requires GPU support and cupy") +class TestCuPy(unittest.TestCase): + @staticmethod + def create_data(): + data = np.random.rand(100,1000) + return data.astype(np.float32) + + def test_as_cupy(self): + data = self.create_data() + + bf_data = bf.ndarray(data, space='cuda') + cp_data = bf_data.as_cupy() + np_data = cp.asnumpy(cp_data) + np.testing.assert_allclose(np_data, data) + def test_from_cupy(self): + data = self.create_data() + + cp_data = cp.asarray(data) + bf_data = bf.ndarray(cp_data) + np_data = bf_data.copy(space='system') + np.testing.assert_allclose(np_data, data) + + def test_stream(self): + data = self.create_data() + + with cp.cuda.Stream() as stream: + with bf.device.ExternalStream(stream): + self.assertEqual(bf.device.get_stream(), stream.ptr) + + bf_data = bf.ndarray(data, space='cuda') + bf.map('a = a + 2', {'a': bf_data}) + cp_data = bf_data.as_cupy() + cp_data *= 4 + np_data = cp.asnumpy(cp_data) + np.testing.assert_allclose(np_data, (data+2)*4) + def test_external_stream(self): + data = self.create_data() + + stream = bf.device.get_stream() + with cp.cuda.ExternalStream(stream): + self.assertEqual(cp.cuda.get_current_stream().ptr, stream) + + bf_data = bf.ndarray(data, space='cuda') + bf.map('a = a + 2', {'a': bf_data}) + cp_data = bf_data.as_cupy() + cp_data *= 4 + np_data = cp.asnumpy(cp_data) + np.testing.assert_allclose(np_data, (data+2)*4) + +@unittest.skipUnless(BF_CUDA_ENABLED and HAVE_PYCUDA, "requires GPU support and cupy") +class TestPyCUDA(unittest.TestCase): + @staticmethod + def create_data(): + data = np.random.rand(100,1000) + return data.astype(np.float32) + + def test_as_gpuarray(self): + data = self.create_data() + + bf_data = bf.ndarray(data, space='cuda') + pc_data = bf_data.as_GPUArray() + np_data = pc_data.get() + np.testing.assert_allclose(np_data, data) + def test_from_gpuarray(self): + data = self.create_data() + + pc_data = pycuda.gpuarray.to_gpu(data) + bf_data = bf.ndarray(pc_data) + np_data = bf_data.copy(space='system') + np.testing.assert_allclose(np_data, data) + + def test_stream(self): + data = self.create_data() + + stream = pycuda.driver.Stream() + with bf.device.ExternalStream(stream): + self.assertEqual(bf.device.get_stream(), stream.handle) + + bf_data = bf.ndarray(data, space='cuda') + bf.map('a = a + 2', {'a': bf_data}) + cp_data = bf_data.as_cupy() + cp_data *= 4 + np_data = cp.asnumpy(cp_data) + np.testing.assert_allclose(np_data, (data+2)*4) diff --git a/test/test_library.py b/test/test_library.py new file mode 100644 index 000000000..8334c4084 --- /dev/null +++ b/test/test_library.py @@ -0,0 +1,7 @@ +import unittest + +from bifrost.libbifrost_generated import bfTestSuite + +class TestLibrary(unittest.TestCase): + def test_library(self): + self.assertEqual(bfTestSuite(), 0) diff --git a/test/test_linalg.py b/test/test_linalg.py index 4153e207e..63c19fb80 100644 --- a/test/test_linalg.py +++ b/test/test_linalg.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,9 +27,6 @@ # **TODO: Add tests with beta != 0 -# Python2 compatibility -from __future__ import print_function - import ctypes import unittest import numpy as np @@ -37,6 +34,8 @@ from bifrost.linalg import LinAlg import bifrost as bf +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + import time RTOL = 1e-4 @@ -45,6 +44,7 @@ def H(c): return np.swapaxes(c, -1, -2).conj() +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TestLinAlg(unittest.TestCase): def setUp(self): self.linalg = LinAlg() diff --git a/test/test_managed.py b/test/test_managed.py new file mode 100644 index 000000000..485829982 --- /dev/null +++ b/test/test_managed.py @@ -0,0 +1,311 @@ + +# Copyright (c) 2021-2022, The Bifrost Authors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import ctypes +import unittest +import numpy as np +import bifrost as bf + +from bifrost.libbifrost_generated import BF_GPU_MANAGEDMEM +from bifrost.device import stream_synchronize + +# +# Map +# + +@unittest.skipUnless(BF_GPU_MANAGEDMEM, "requires GPU managed memory support") +class TestManagedMap(unittest.TestCase): + def setUp(self): + np.random.seed(1234) + def run_simple_test(self, x, funcstr, func): + x_orig = x + x = bf.asarray(x, 'cuda_managed') + y = bf.empty_like(x) + x.flags['WRITEABLE'] = False + x.bf.immutable = True # TODO: Is this actually doing anything? (flags is, just not sure about bf.immutable) + for _ in range(3): + bf.map(funcstr, {'x': x, 'y': y}) + stream_synchronize() + if isinstance(x_orig, bf.ndarray): + x_orig = x + # Note: Using func(x) is dangerous because bf.ndarray does things like + # lazy .conj(), which break when used as if it were np.ndarray. + np.testing.assert_equal(y, func(x_orig)) + def run_simple_test_funcs(self, x): + self.run_simple_test(x, "y = x+1", lambda x: x + 1) + self.run_simple_test(x, "y = x*3", lambda x: x * 3) + # Note: Must use "f" suffix to avoid very slow double-precision math + self.run_simple_test(x, "y = rint(pow(x, 2.f))", lambda x: x**2) + self.run_simple_test(x, "auto tmp = x; y = tmp*tmp", lambda x: x * x) + self.run_simple_test(x, "y = x; y += x", lambda x: x + x) + def test_simple_2D(self): + n = 89 + x = np.random.randint(256, size=(n,n)) + self.run_simple_test_funcs(x) + def test_simple_2D_padded(self): + n = 89 + x = np.random.randint(256, size=(n,n)) + x = bf.asarray(x, space='cuda') + x = x[:,1:] + self.run_simple_test_funcs(x) + +# +# FFT +# + +# Note: Numpy FFTs are always double precision, which is good for this purpose +from numpy.fft import fftn as gold_fftn, ifftn as gold_ifftn +from numpy.fft import rfftn as gold_rfftn, irfftn as gold_irfftn +from bifrost.fft import Fft + +MTOL = 1e-6 # Relative tolerance at the mean magnitude +RTOL = 1e-1 + +def compare(result, gold): + #np.testing.assert_allclose(result, gold, RTOL, ATOL) + # Note: We compare using an absolute tolerance equal to a fraction of the + # mean magnitude. This ignores large relative errors on values with + # magnitudes much smaller than the mean. + absmean = np.abs(gold).mean() + np.testing.assert_allclose(result, gold, rtol=RTOL, atol=MTOL * absmean) + +@unittest.skipUnless(BF_GPU_MANAGEDMEM, "requires GPU managed memory support") +class TestManagedFFT(unittest.TestCase): + def setUp(self): + np.random.seed(1234) + self.shape1D = (16777216,) + self.shape2D = (2048, 2048) + self.shape3D = (128, 128, 128) + self.shape4D = (32, 32, 32, 32) + # Note: Last dim must be even to avoid output alignment error + self.shape4D_odd = (33, 31, 65, 16) + def run_test_r2c_dtype(self, shape, axes, dtype=np.float32, scale=1., misalign=0): + known_data = np.random.normal(size=shape).astype(np.float32) + known_data = (known_data * scale).astype(dtype) + + # Force misaligned data + padded_shape = shape[:-1] + (shape[-1] + misalign,) + known_data = np.resize(known_data, padded_shape) + idata = bf.ndarray(known_data, space='cuda_managed') + known_data = known_data[..., misalign:] + idata = idata[..., misalign:] + + oshape = list(shape) + oshape[axes[-1]] = shape[axes[-1]] // 2 + 1 + odata = bf.ndarray(shape=oshape, dtype='cf32', space='cuda_managed') + fft = Fft() + fft.init(idata, odata, axes=axes) + fft.execute(idata, odata) + stream_synchronize() + known_result = gold_rfftn(known_data.astype(np.float32) / scale, axes=axes) + compare(odata, known_result) + def run_test_r2c(self, shape, axes, dtype=np.float32): + self.run_test_r2c_dtype(shape, axes, np.float32) + # Note: Misalignment is not currently supported for fp32 + #self.run_test_r2c_dtype(shape, axes, np.float32, misalign=1) + #self.run_test_r2c_dtype(shape, axes, np.float16) # TODO: fp16 support + for misalign in range(4): + self.run_test_r2c_dtype(shape, axes, np.int16, (1 << 15) - 1, misalign=misalign) + for misalign in range(8): + self.run_test_r2c_dtype(shape, axes, np.int8, (1 << 7 ) - 1, misalign=misalign) + def test_r2c_1D(self): + self.run_test_r2c(self.shape1D, [0]) + def test_r2c_2D(self): + self.run_test_r2c(self.shape2D, [0, 1]) + def test_r2c_3D(self): + self.run_test_r2c(self.shape3D, [0, 1, 2]) + +# +# FIR +# + +from scipy.signal import lfilter, lfiltic +from bifrost.fir import Fir + +def compare(result, gold): + #np.testing.assert_allclose(result, gold, RTOL, ATOL) + # Note: We compare using an absolute tolerance equal to a fraction of the + # mean magnitude. This ignores large relative errors on values with + # magnitudes much smaller than the mean. + absmean = np.abs(gold).mean() + np.testing.assert_allclose(result, gold, rtol=RTOL, atol=MTOL * absmean) + +@unittest.skipUnless(BF_GPU_MANAGEDMEM, "requires GPU managed memory support") +class TestManagedFIR(unittest.TestCase): + def setUp(self): + np.random.seed(1234) + self.shape2D = (10000, 96*2) + self.shape3D = (10000, 48, 4) + self.coeffs = np.array(( 0.0035002, -0.0053712, 0.0090177, -0.013789, 0.0196580, + -0.0264910, 0.0340400, -0.0419570, 0.049807, -0.0571210, + 0.0634200, -0.0682750, 0.0713370, 0.927620, 0.0713370, + -0.0682750, 0.0634200, -0.0571210, 0.049807, -0.0419570, + 0.0340400, -0.0264910, 0.0196580, -0.013789, 0.0090177, + -0.0053712, 0.0035002), dtype=np.float64) + def test_2d_initial(self): + shape = self.shape2D + known_data = np.random.normal(size=shape).astype(np.float32).view(np.complex64) + idata = bf.ndarray(known_data, space='cuda_managed') + odata = bf.empty_like(idata) + coeffs = self.coeffs*1.0 + coeffs.shape += (1,) + coeffs = np.repeat(coeffs, idata.shape[1], axis=1) + coeffs.shape = (coeffs.shape[0],idata.shape[1]) + coeffs = bf.ndarray(coeffs, space='cuda_managed') + + fir = Fir() + fir.init(coeffs, 1) + fir.execute(idata, odata) + stream_synchronize() + + for i in range(known_data.shape[1]): + zf = lfiltic(self.coeffs, 1.0, 0.0) + known_result, zf = lfilter(self.coeffs, 1.0, known_data[:,i], zi=zf) + compare(odata[:,i], known_result) + def test_2d_active(self): + shape = self.shape2D + known_data = np.random.normal(size=shape).astype(np.float32).view(np.complex64) + idata = bf.ndarray(known_data, space='cuda_managed') + odata = bf.empty_like(idata) + coeffs = self.coeffs*1.0 + coeffs.shape += (1,) + coeffs = np.repeat(coeffs, idata.shape[1], axis=1) + coeffs.shape = (coeffs.shape[0],idata.shape[1]) + coeffs = bf.ndarray(coeffs, space='cuda_managed') + + fir = Fir() + fir.init(coeffs, 1) + fir.execute(idata, odata) + fir.execute(idata, odata) + stream_synchronize() + + for i in range(known_data.shape[1]): + zf = lfiltic(self.coeffs, 1.0, 0.0) + known_result, zf = lfilter(self.coeffs, 1.0, known_data[:,i], zi=zf) + known_result, zf = lfilter(self.coeffs, 1.0, known_data[:,i], zi=zf) + compare(odata[:,i], known_result) + +# +# Reduce +# + +def stderr(data, axis): + return np.sum(data, axis=axis) / np.sqrt(data.shape[axis]) + +NP_OPS = { + 'sum': np.sum, + 'mean': np.mean, + 'min': np.min, + 'max': np.max, + 'stderr': stderr +} + +def scrunch(data, factor=2, axis=0, func=np.sum): + if factor is None: + factor = data.shape[axis] + s = data.shape + if s[axis] % factor != 0: + raise ValueError("Scrunch factor does not divide axis size") + s = s[:axis] + (s[axis]//factor, factor) + s[axis:][1:] + axis = axis + 1 if axis >= 0 else axis + return func(data.reshape(s), axis=axis) + +def pwrscrunch(data, factor=2, axis=0, func=np.sum): + if factor is None: + factor = data.shape[axis] + s = data.shape + if s[axis] % factor != 0: + raise ValueError("Scrunch factor does not divide axis size") + s = s[:axis] + (s[axis]//factor, factor) + s[axis:][1:] + axis = axis + 1 if axis >= 0 else axis + return func(np.abs(data.reshape(s))**2, axis=axis) + +@unittest.skipUnless(BF_GPU_MANAGEDMEM, "requires GPU managed memory support") +class TestManagedReduce(unittest.TestCase): + def setUp(self): + np.random.seed(1234) + def run_reduce_test(self, shape, axis, n, op='sum', dtype=np.float32): + a = ((np.random.random(size=shape)*2-1)*127).astype(np.int8).astype(dtype) + if op[:3] == 'pwr': + b_gold = pwrscrunch(a.astype(np.float32), n, axis, NP_OPS[op[3:]]) + else: + b_gold = scrunch(a.astype(np.float32), n, axis, NP_OPS[op]) + a = bf.asarray(a, space='cuda_managed') + b = bf.empty_like(b_gold, space='cuda_managed') + bf.reduce(a, b, op) + stream_synchronize() + np.testing.assert_allclose(b, b_gold) + def test_reduce(self): + self.run_reduce_test((3,6,5), axis=1, n=2, op='sum', dtype=np.float32) + for shape in [(20,20,40), (20,40,60), (40,100,200)]: + for axis in range(3): + for n in [2, 4, 5, 10, None]: + for op in ['sum', 'mean', 'pwrsum', 'pwrmean']: + for dtype in [np.float32, np.int16, np.int8]: + self.run_reduce_test(shape, axis, n, op, dtype) + +# +# Unpack +# + +import bifrost.unpack + +@unittest.skipUnless(BF_GPU_MANAGEDMEM, "requires GPU managed memory support") +class TestManagedUnpack(unittest.TestCase): + def run_unpack_to_ci8_test(self, iarray): + oarray = bf.ndarray(shape=iarray.shape, dtype='ci8', space='cuda_managed') + oarray_known = bf.ndarray([[(0, 1), (2, 3)], + [(4, 5), (6, 7)], + [(-8, -7), (-6, -5)]], + dtype='ci8') + bf.unpack(iarray.copy(space='cuda_managed'), oarray) + stream_synchronize() + np.testing.assert_equal(oarray, oarray_known) + def test_ci4_to_ci8(self): + iarray = bf.ndarray([[(0x10,),(0x32,)], + [(0x54,),(0x76,)], + [(0x98,),(0xBA,)]], + dtype='ci4') + self.run_unpack_to_ci8_test(iarray) + def test_ci4_to_ci8_byteswap(self): + iarray = bf.ndarray([[(0x01,),(0x23,)], + [(0x45,),(0x67,)], + [(0x89,),(0xAB,)]], + dtype='ci4') + self.run_unpack_to_ci8_test(iarray.byteswap()) + def test_ci4_to_ci8_conjugate(self): + iarray = bf.ndarray([[(0xF0,),(0xD2,)], + [(0xB4,),(0x96,)], + [(0x78,),(0x5A,)]], + dtype='ci4') + self.run_unpack_to_ci8_test(iarray.conj()) + def test_ci4_to_ci8_byteswap_conjugate(self): + iarray = bf.ndarray([[(0x0F,),(0x2D,)], + [(0x4B,),(0x69,)], + [(0x87,),(0xA5,)]], + dtype='ci4') + self.run_unpack_to_ci8_test(iarray.byteswap().conj()) diff --git a/test/test_map.py b/test/test_map.py index 2325e14de..7c2b1c6b4 100644 --- a/test/test_map.py +++ b/test/test_map.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,14 +25,26 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import sys import ctypes import unittest import numpy as np import bifrost as bf +from io import StringIO + +from bifrost.libbifrost_generated import BF_CUDA_ENABLED +_FIRST_TEST = True + +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TestMap(unittest.TestCase): + # TODO: @classmethod; def setUpClass(kls) def setUp(self): np.random.seed(1234) + global _FIRST_TEST + if _FIRST_TEST: + bf.clear_map_cache() + _FIRST_TEST = False def run_simple_test(self, x, funcstr, func): x_orig = x x = bf.asarray(x, 'cuda') @@ -128,7 +140,7 @@ def test_shift(self): a = a.copy('system') b = b.copy('system') np.testing.assert_equal(b, np.fft.fftshift(a)) - def test_complex(self): + def test_complex_float(self): n = 89 real = np.random.randint(-127, 128, size=(n,n)).astype(np.float32) imag = np.random.randint(-127, 128, size=(n,n)).astype(np.float32) @@ -138,6 +150,39 @@ def test_complex(self): self.run_simple_test(x, "y = x*x.conj()", lambda x: x * x.conj()) self.run_simple_test(x, "y = x.mag2()", lambda x: x * x.conj()) self.run_simple_test(x, "y = 3*x", lambda x: 3 * x) + def test_complex_integer(self): + n = 7919 + for in_dtype in ('ci4', 'ci8', 'ci16', 'ci32'): + a_orig = bf.ndarray(shape=(n,), dtype=in_dtype, space='system') + try: + a_orig['re'] = np.random.randint(256, size=n) + a_orig['im'] = np.random.randint(256, size=n) + except ValueError: + # ci4 is different + a_orig['re_im'] = np.random.randint(256, size=n, dtype=np.uint8) + for out_dtype in (in_dtype, 'cf32'): + a = a_orig.copy(space='cuda') + b = bf.ndarray(shape=(n,), dtype=out_dtype, space='cuda') + bf.map('b(i) = a(i)', {'a': a, 'b': b}, shape=a.shape, axis_names=('i',)) + a = a.copy(space='system') + try: + a = a['re'] + 1j*a['im'] + except ValueError: + # ci4 is different + a = np.int8(a['re_im'] & 0xF0) + 1j*np.int8((a['re_im'] & 0x0F) << 4) + a /= 16 + b = b.copy(space='system') + try: + b = b['re'] + 1j*b['im'] + except ValueError: + # ci4 is different + b = np.int8(b['re_im'] & 0xF0) + 1j*np.int8((b['re_im'] & 0x0F) << 4) + b /= 16 + except IndexError: + # pass through cf32 + pass + np.testing.assert_equal(a, b) + def test_polarisation_products(self): n = 89 real = np.random.randint(-127, 128, size=(n,2)).astype(np.float32) @@ -184,3 +229,15 @@ def test_custom_shape(self): a = a.copy('system') b = b.copy('system') np.testing.assert_equal(b, a[:,j,:]) + def test_list_cache(self): + # TODO: would be nicer as a context manager, something like + # contextlib.redirect_stdout + orig_stdout = sys.stdout + new_stdout = StringIO() + sys.stdout = new_stdout + + try: + bf.list_map_cache() + finally: + sys.stdout = orig_stdout + new_stdout.close() diff --git a/test/test_ndarray.py b/test/test_ndarray.py index d587c17c1..267ac7a68 100644 --- a/test/test_ndarray.py +++ b/test/test_ndarray.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,6 +28,10 @@ import unittest import numpy as np import bifrost as bf +import ctypes + +from bifrost.libbifrost_generated import BF_CUDA_ENABLED +from bifrost.DataType import DataType class NDArrayTest(unittest.TestCase): def setUp(self): @@ -40,17 +44,77 @@ def test_assign(self): b = bf.ndarray(shape=(3,2), dtype='f32') b[...] = self.known_array np.testing.assert_equal(b, self.known_array) + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") def test_space_copy(self): c = bf.ndarray(self.known_vals, dtype='f32') c = c.copy(space='cuda').copy(space='cuda_host').copy(space='system') np.testing.assert_equal(c, self.known_array) + def run_contiguous_copy(self, space='system'): + a = np.random.rand(2,3,4,5) + a = a.astype(np.float64) + b = a.transpose(0,3,2,1).copy() + c = bf.zeros(a.shape, dtype=a.dtype, space='system') + c[...] = a + c = c.copy(space=space) + d = c.transpose(0,3,2,1).copy(space='system') + # Use ctypes to directly access the memory + b_data = ctypes.cast(b.ctypes.data, ctypes.POINTER(ctypes.c_double)) + b_data = np.array([b_data[i] for i in range(b.size)]) + d_data = ctypes.cast(d.ctypes.data, ctypes.POINTER(ctypes.c_double)) + d_data = np.array([d_data[i] for i in range(d.size)]) + np.testing.assert_equal(d_data, b_data) + def test_contiguous_copy(self): + self.run_contiguous_copy() + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") + def test_space_contiguous_copy(self): + self.run_contiguous_copy(space='cuda') + def run_slice_copy(self, space='system'): + a = np.random.rand(2,3,4,5) + a = a.astype(np.float64) + b = a[:,1:,:,:].copy() + c = bf.zeros(a.shape, dtype=a.dtype, space='system') + c[...] = a + c = c.copy(space=space) + d = c[:,1:,:,:].copy(space='system') + # Use ctypes to directly access the memory + b_data = ctypes.cast(b.ctypes.data, ctypes.POINTER(ctypes.c_double)) + b_data = np.array([b_data[i] for i in range(b.size)]) + d_data = ctypes.cast(d.ctypes.data, ctypes.POINTER(ctypes.c_double)) + d_data = np.array([d_data[i] for i in range(d.size)]) + np.testing.assert_equal(d_data, b_data) + def test_slice_copy(self): + self.run_slice_copy() + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") + def test_space_slice_copy(self): + self.run_slice_copy(space='cuda') + def run_contiguous_slice_copy(self, space='system'): + a = np.random.rand(2,3,4,5) + a = a.astype(np.float64) + b = a.transpose(0,3,2,1)[:,1:,:,:].copy() + c = bf.zeros(a.shape, dtype=a.dtype, space='system') + c[...] = a + c = c.copy(space=space) + d = c.transpose(0,3,2,1)[:,1:,:,:].copy(space='system') + # Use ctypes to directly access the memory + b_data = ctypes.cast(b.ctypes.data, ctypes.POINTER(ctypes.c_double)) + b_data = np.array([b_data[i] for i in range(b.size)]) + d_data = ctypes.cast(d.ctypes.data, ctypes.POINTER(ctypes.c_double)) + d_data = np.array([d_data[i] for i in range(d.size)]) + np.testing.assert_equal(d_data, b_data) + def test_contiguous_slice_copy(self): + self.run_contiguous_slice_copy() + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") + def test_space_contiguous_slice_copy(self): + self.run_contiguous_slice_copy(space='cuda') def test_view(self): d = bf.ndarray(self.known_vals, dtype='f32') d = d.view(dtype='cf32') np.testing.assert_equal(d, np.array([[0 + 1j], [2 + 3j], [4 + 5j]])) + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") def test_str(self): e = bf.ndarray(self.known_vals, dtype='f32', space='cuda') self.assertEqual(str(e), str(self.known_array)) + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") def test_repr(self): f = bf.ndarray(self.known_vals, dtype='f32', space='cuda') repr_f = repr(f) @@ -62,18 +126,21 @@ def test_repr(self): repr_f = repr_f.replace(' ', '') repr_k = repr_k.replace(' ', '') self.assertEqual(repr_f, repr_k) + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") def test_zeros_like(self): g = bf.ndarray(self.known_vals, dtype='f32', space='cuda') g = bf.zeros_like(g) g = g.copy('system') known = np.zeros_like(self.known_array) np.testing.assert_equal(g, known) + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") def test_getitem(self): g = bf.ndarray(self.known_vals, space='cuda') np.testing.assert_equal(g[0].copy('system'), self.known_array[0]) np.testing.assert_equal(g[(0,)].copy('system'), self.known_array[(0,)]) np.testing.assert_equal(int(g[0,0]), self.known_array[0,0]) np.testing.assert_equal(g[:1,1:].copy('system'), self.known_array[:1,1:]) + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") def test_setitem(self): g = bf.zeros_like(self.known_vals, space='cuda') g[...] = self.known_vals @@ -86,3 +153,55 @@ def test_setitem(self): np.testing.assert_equal(g.copy('system'), np.array([[99,88],[2,3],[4,5]])) g[:,1] = [77,66,55] np.testing.assert_equal(g.copy('system'), np.array([[99,77],[2,66],[4,55]])) + def run_type_conversion(self, space='system'): + # Real + for dtype_in in (np.int8, np.int16, np.int32, np.float32, np.float64): + a = np.array(self.known_vals, dtype=dtype_in) + c = bf.ndarray(a, dtype=dtype_in, space=space) + for dtype in ('i8', 'i16', 'i32', 'i64', 'f64', 'ci8', 'ci16', 'ci32', 'cf32', 'cf64'): + np_dtype = DataType(dtype).as_numpy_dtype() + try: + ## Catch for the complex integer types + len(np_dtype) + b = np.zeros(a.shape, dtype=np_dtype) + b['re'] = a + except (IndexError, TypeError): + b = a.astype(np_dtype) + d = c.astype(dtype) + d = d.copy(space='system') + np.testing.assert_equal(b, d) + # Complex + for dtype_in,dtype_in_cmplx in zip((np.float32,np.float64), ('cf32', 'cf64')): + a = np.array(self.known_vals, dtype=dtype_in) + a = np.stack([a,a[::-1]], axis=0) + a = a.view(np.complex64) + c = bf.ndarray(a, dtype=dtype_in_cmplx, space=space) + for dtype in ('ci8', 'ci16', 'ci32', 'cf32', 'cf64', 'i8', 'i16', 'i32', 'i64', 'f64'): + np_dtype = DataType(dtype).as_numpy_dtype() + try: + ## Catch for the complex integer types + len(np_dtype) + b = np.zeros(a.shape, dtype=np_dtype) + b['re'] = a.real + b['im'] = a.imag + except (IndexError, TypeError): + b = a.astype(np_dtype) + d = c.astype(dtype) + d = d.copy(space='system') + np.testing.assert_equal(b, d) + def test_type_conversion(self): + self.run_type_conversion() + @unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") + def test_space_type_conversion(self): + self.run_type_conversion(space='cuda') + def test_BFarray(self): + """ Test ndarray.as_BFarray() roundtrip """ + a = bf.ndarray(np.arange(100), dtype='i32') + aa = a.as_BFarray() + b = bf.ndarray(aa) + np.testing.assert_equal(a, b) + + a = bf.ndarray(np.arange(100), dtype='cf32') + aa = a.as_BFarray() + b = bf.ndarray(aa) + np.testing.assert_equal(a, b) diff --git a/test/test_pipeline.py b/test/test_pipeline.py index 88acdd527..f40d30cac 100644 --- a/test/test_pipeline.py +++ b/test/test_pipeline.py @@ -33,6 +33,8 @@ from bifrost.blocks import * from bifrost.pipeline import SourceBlock, TransformBlock, SinkBlock +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + from copy import deepcopy RTOL = 1e-4 @@ -107,6 +109,7 @@ def on_data(self, ispan): # downstream callback blocks from ever executing. self.data_ref['idata'] = ispan.data.copy() +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class PipelineTest(unittest.TestCase): def setUp(self): # Note: This file needs to be large enough to fill the minimum-size diff --git a/test/test_pipeline_cpu.py b/test/test_pipeline_cpu.py index 4253ded72..0c6b6da92 100644 --- a/test/test_pipeline_cpu.py +++ b/test/test_pipeline_cpu.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,11 +26,13 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import unittest -import os +import os, sys import bifrost as bf from bifrost.blocks import * +from io import StringIO + class CallbackBlock(CopyBlock): """Testing-only block which calls user-defined functions on sequence and on data""" @@ -59,20 +61,6 @@ def rename_sequence(hdr, name): hdr['name'] = name return hdr -class suppress_fd(object): - def __init__(self, fd): - if fd.lower() == 'stdout': fd = 1 - elif fd.lower() == 'stderr': fd = 2 - else: assert(isinstance(fd, int)) - self.fd = fd - self.devnull = os.open(os.devnull, os.O_RDWR) - self.stderr = os.dup(self.fd) # Save original - def __enter__(self): - os.dup2(self.devnull, self.fd) # Set stderr to devnull - def __exit__(self, type, value, tb): - os.dup2(self.stderr, self.fd) # Restore original - os.close(self.devnull) - class PipelineTestCPU(unittest.TestCase): def setUp(self): # Note: This file needs to be large enough to fill the minimum-size @@ -174,5 +162,13 @@ def check_data(ispan, ospan): data = CallbackBlock(data, check_sequence, check_data) data = copy(data) data = copy(data) - with suppress_fd('stderr'): + # TODO: would be nicer as a context manager, something like + # contextlib.redirect_stdout + orig_stderr = sys.stderr + new_stderr = StringIO() + sys.stderr = new_stderr + try: self.assertRaises(bf.pipeline.PipelineInitError, pipeline.run) + finally: + sys.stderr = orig_stderr + new_stderr.close() diff --git a/test/test_print_header.py b/test/test_print_header.py index 23fdce263..1c0c5d944 100644 --- a/test/test_print_header.py +++ b/test/test_print_header.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,7 +26,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import unittest -import io +from io import StringIO import bifrost.pipeline as bfp import bifrost.blocks as blocks @@ -44,7 +44,7 @@ def test_read_sigproc(self): """Capture print output, assert it is a long string""" gulp_nframe = 101 - stdout = io.BytesIO() + stdout = StringIO() with ExitStack() as stack: pipeline = stack.enter_context(bfp.Pipeline()) stack.enter_context(redirect_stdout(stdout)) diff --git a/test/test_quantize.py b/test/test_quantize.py index 5b3c9edfc..a906bcbf5 100644 --- a/test/test_quantize.py +++ b/test/test_quantize.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ import unittest import numpy as np import bifrost as bf -import bifrost.quantize class QuantizeTest(unittest.TestCase): def run_quantize_from_cf32_test(self, out_dtype): @@ -41,7 +40,7 @@ def run_quantize_from_cf32_test(self, out_dtype): [(2,2), (3,4)], [(4,4), (5,6)]], dtype=out_dtype) - bf.quantize.quantize(iarray, oarray) + bf.quantize(iarray, oarray) np.testing.assert_equal(oarray, oarray_known) def test_cf32_to_ci8(self): self.run_quantize_from_cf32_test('ci8') diff --git a/test/test_reduce.py b/test/test_reduce.py index 634a83fa6..d1866e283 100644 --- a/test/test_reduce.py +++ b/test/test_reduce.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,6 +28,9 @@ import unittest import numpy as np import bifrost as bf + +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + #import time def stderr(data, axis): @@ -61,6 +64,7 @@ def pwrscrunch(data, factor=2, axis=0, func=np.sum): axis = axis + 1 if axis >= 0 else axis return func(np.abs(data.reshape(s))**2, axis=axis) +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class ReduceTest(unittest.TestCase): def setUp(self): np.random.seed(1234) @@ -73,16 +77,33 @@ def run_reduce_test(self, shape, axis, n, op='sum', dtype=np.float32): a = bf.asarray(a, space='cuda') b = bf.empty_like(b_gold, space='cuda') bf.reduce(a, b, op) - #for _ in range(10): - # bf.reduce(a, b, op) - #bf.device.stream_synchronize(); - #t0 = time.time() - #nrep = 30 - #for _ in range(nrep): - # bf.reduce(a, b, op) - #bf.device.stream_synchronize(); - #dt = time.time() - t0 - #print nrep * (a.nbytes + b.nbytes) / dt / 1e9, 'GB/s', shape, axis, n, dtype + b = b.copy('system') + np.testing.assert_allclose(b, b_gold) + def run_reduce_slice_test(self, shape, axis, n, op='sum', dtype=np.float32): + if n is None: + return None + a = ((np.random.random(size=shape)*2-1)*127).astype(np.int8).astype(dtype) + if axis == 0: + a_slice = a[1:((a.shape[0]-1)//n-1)*n+1,...] + elif axis == 1: + a_slice = a[:,1:((a.shape[1]-1)//n-1)*n+1,:] + else: + a_slice = a[...,1:((a.shape[-1]-1)//n-1)*n+1] + if a_slice.shape[0] == 0 or a_slice.shape[1] == 0 or a_slice.shape[-1] == 0: + return None + if op[:3] == 'pwr': + b_gold = pwrscrunch(a_slice.astype(np.float32), n, axis, NP_OPS[op[3:]]) + else: + b_gold = scrunch(a_slice.astype(np.float32), n, axis, NP_OPS[op]) + a = bf.ndarray(a, space='cuda') + if axis == 0: + a_slice = a[1:((a.shape[0]-1)//n-1)*n+1,...] + elif axis == 1: + a_slice = a[:,1:((a.shape[1]-1)//n-1)*n+1,:] + else: + a_slice = a[...,1:((a.shape[-1]-1)//n-1)*n+1] + b = bf.empty_like(b_gold, space='cuda') + bf.reduce(a_slice, b, op) b = b.copy('system') np.testing.assert_allclose(b, b_gold) def test_reduce(self): @@ -94,6 +115,7 @@ def test_reduce(self): for dtype in [np.float32, np.int16, np.int8]: #print shape, axis, n, op, dtype self.run_reduce_test(shape, axis, n, op, dtype) + self.run_reduce_slice_test(shape, axis, n, op, dtype) def test_reduce_pow2(self): for shape in [(16,32,64), (16,64,256), (256,64,16)]:#, (256, 256, 512)]: for axis in range(3): @@ -102,6 +124,7 @@ def test_reduce_pow2(self): for dtype in [np.float32, np.int16, np.int8]: #print shape, axis, n, op, dtype self.run_reduce_test(shape, axis, n, op, dtype) + self.run_reduce_slice_test(shape, axis, n, op, dtype) def run_complex_reduce_test(self, shape, axis, n, op='sum', dtype=np.complex64): a = ((np.random.random(size=shape)*2-1)*127).astype(np.int8).astype(dtype) \ @@ -113,16 +136,34 @@ def run_complex_reduce_test(self, shape, axis, n, op='sum', dtype=np.complex64): a = bf.asarray(a, space='cuda') b = bf.empty_like(b_gold, space='cuda') bf.reduce(a, b, op) - #for _ in range(10): - # bf.reduce(a, b, op) - #bf.device.stream_synchronize(); - #t0 = time.time() - #nrep = 30 - #for _ in range(nrep): - # bf.reduce(a, b, op) - #bf.device.stream_synchronize(); - #dt = time.time() - t0 - #print nrep * (a.nbytes + b.nbytes) / dt / 1e9, 'GB/s', shape, axis, n, dtype + b = b.copy('system') + np.testing.assert_allclose(b, b_gold, rtol=1e-3 if op[:3] == 'pwr' else 1e-7) + def run_complex_reduce_slice_test(self, shape, axis, n, op='sum', dtype=np.float32): + if n is None: + return None + a = ((np.random.random(size=shape)*2-1)*127).astype(np.int8).astype(dtype) \ + + 1j*((np.random.random(size=shape)*2-1)*127).astype(np.int8).astype(dtype) + if axis == 0: + a_slice = a[1:((a.shape[0]-1)//n-1)*n+1,...] + elif axis == 1: + a_slice = a[:,1:((a.shape[1]-1)//n-1)*n+1,:] + else: + a_slice = a[...,1:((a.shape[-1]-1)//n-1)*n+1] + if a_slice.shape[0] == 0 or a_slice.shape[1] == 0 or a_slice.shape[-1] == 0: + return None + if op[:3] == 'pwr': + b_gold = pwrscrunch(a_slice.astype(np.complex64), n, axis, NP_OPS[op[3:]]) + else: + b_gold = scrunch(a_slice.astype(np.complex64), n, axis, NP_OPS[op]) + a = bf.ndarray(a, space='cuda') + if axis == 0: + a_slice = a[1:((a.shape[0]-1)//n-1)*n+1,...] + elif axis == 1: + a_slice = a[:,1:((a.shape[1]-1)//n-1)*n+1,:] + else: + a_slice = a[...,1:((a.shape[-1]-1)//n-1)*n+1] + b = bf.empty_like(b_gold, space='cuda') + bf.reduce(a_slice, b, op) b = b.copy('system') np.testing.assert_allclose(b, b_gold, rtol=1e-3 if op[:3] == 'pwr' else 1e-7) def test_complex_reduce(self): @@ -134,6 +175,7 @@ def test_complex_reduce(self): for dtype in [np.complex64,]: #print shape, axis, n, op, dtype self.run_complex_reduce_test(shape, axis, n, op, dtype) + self.run_complex_reduce_slice_test(shape, axis, n, op, dtype) def test_complex_reduce_pow2(self): for shape in [(16,32,64), (16,64,256), (256,64,16)]:#, (256, 256, 512)]: for axis in range(3): @@ -142,3 +184,4 @@ def test_complex_reduce_pow2(self): for dtype in [np.complex64,]: #print shape, axis, n, op, dtype self.run_complex_reduce_test(shape, axis, n, op, dtype) + self.run_complex_reduce_slice_test(shape, axis, n, op, dtype) diff --git a/test/test_resizing.py b/test/test_resizing.py index 7630b7137..ebf9493b0 100644 --- a/test/test_resizing.py +++ b/test/test_resizing.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -41,11 +41,11 @@ def __init__(self, filename, gulp_size=None): open(self.filename, "w").close() def load_settings(self, input_header): """Load the header, and set the gulp appropriately""" - header_dict = json.loads(input_header.tostring()) + header_dict = json.loads(input_header.tobytes()) self.shape = header_dict['shape'] size_of_float32 = 4 if self.gulp_size is None: - self.gulp_size = np.product(self.shape) * size_of_float32 + self.gulp_size = np.prod(self.shape) * size_of_float32 def iterate_ring_read(self, input_ring): """Iterate through one input ring @param[in] input_ring Ring to read through""" @@ -58,7 +58,7 @@ def main(self, input_ring): """Initiate the writing to file @param[in] input_rings First ring in this list will be used""" span_generator = self.iterate_ring_read(input_ring) - span = span_generator.next() + span = next(span_generator) text_file = open(self.filename, 'a') np.savetxt(text_file, span.data_view(np.float32).reshape((1,-1))) text_file.close() diff --git a/test/test_romein.py b/test/test_romein.py index 93b327a5d..414f8fd26 100644 --- a/test/test_romein.py +++ b/test/test_romein.py @@ -1,5 +1,5 @@ -# Copyright (c) 2018, The Bifrost Authors. All rights reserved. +# Copyright (c) 2018-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,8 +25,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - import unittest import numpy import bifrost @@ -35,6 +33,9 @@ from bifrost.unpack import unpack from bifrost.DataType import ci4 +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class RomeinTest(unittest.TestCase): def setUp(self): self.romein=Romein() @@ -59,52 +60,48 @@ def naive_romein(self, unpack(data, data_unpacked) data = data_unpacked - #Excruciatingly slow, but it's just for testing purposes... - #Could probably use a blas based function for simplicity. - grid = numpy.zeros(shape=grid_shape,dtype=dtype) - for t in numpy.arange(ntime): - for c in numpy.arange(nchan): - for p in numpy.arange(npol): - for d in numpy.arange(ndata): - datapoint = data[t,c,p,d] - if data.dtype != dtype: - try: - datapoint = dtype(datapoint[0]+1j*datapoint[1]) - except IndexError: - datapoint = dtype(datapoint) - - #if(d==128): - # print(datapoint) - x_s = xlocs[t,c,p,d] - y_s = ylocs[t,c,p,d] - for y in numpy.arange(y_s,y_s+illum.shape[4]): - for x in numpy.arange(x_s,x_s+illum.shape[5]): - illump = illum[t,c,p,d,y-y_s,x-x_s] - grid[t,c,p,y,x] += datapoint * illump + # Create the output grid + grid = bifrost.zeros(shape=grid_shape,dtype=dtype) + + # Combine axes + xlocs_flat = xlocs.reshape(-1,ndata) + ylocs_flat = ylocs.reshape(-1,ndata) + data_flat = data.reshape(-1,ndata) + grid_flat = grid.reshape(-1,grid.shape[-2],grid.shape[-1]) + illum_flat = illum.reshape(-1,ndata,illum.shape[-2],illum.shape[-1]) + + # Excruciatingly slow, but it's just for testing purposes... + # Could probably use a blas based function for simplicity. + for tcp in range(data_flat.shape[0]): + for d in range(ndata): + datapoint = data_flat[tcp,d] + if data.dtype != dtype: + try: + datapoint = dtype(datapoint[0]+1j*datapoint[1]) + except IndexError: + datapoint = dtype(datapoint) + + #if(d==128): + # print(datapoint) + x_s = xlocs_flat[tcp,d] + y_s = ylocs_flat[tcp,d] + for y in range(y_s,y_s+illum_flat.shape[-2]): + for x in range(x_s,x_s+illum_flat.shape[-1]): + illump = illum_flat[tcp,d,y-y_s,x-x_s] + grid_flat[tcp,y,x] += datapoint * illump return grid def _create_illum(self, illum_size, data_size, ntime, npol, nchan, dtype=numpy.complex64): illum_shape = (ntime,nchan,npol,data_size,illum_size,illum_size) - illum = numpy.ones(shape=illum_shape,dtype=dtype) - illum = numpy.copy(illum,order='C') - illum = bifrost.ndarray(illum) + illum = bifrost.zeros(shape=illum_shape,dtype=dtype) + illum += 1 return illum def _create_locs(self, data_size, ntime, nchan, npol, loc_min, loc_max): ishape = (ntime,nchan,npol,data_size) - xlocs = numpy.random.uniform(loc_min, loc_max, size=ishape) - ylocs = numpy.random.uniform(loc_min, loc_max, size=ishape) - zlocs = numpy.random.uniform(loc_min, loc_max, size=ishape) - xlocs = numpy.copy(xlocs.astype(numpy.int32),order='C') - ylocs = numpy.copy(ylocs.astype(numpy.int32),order='C') - zlocs = numpy.copy(zlocs.astype(numpy.int32),order='C') - xlocs = bifrost.ndarray(xlocs) - ylocs = bifrost.ndarray(ylocs) - zlocs = bifrost.ndarray(zlocs) - locs = numpy.stack((xlocs, ylocs, zlocs)) - #locs = numpy.transpose(locs,(1,2,3,4,0)) + locs = numpy.random.uniform(loc_min, loc_max, size=(3,)+ishape) locs = numpy.copy(locs.astype(numpy.int32),order='C') locs = bifrost.ndarray(locs) @@ -112,12 +109,10 @@ def _create_locs(self, data_size, ntime, nchan, npol, loc_min, loc_max): def _create_data(self, data_size, ntime, nchan, npol, dtype=numpy.complex64): ishape = (ntime,nchan,npol,data_size) - data = numpy.zeros(shape=ishape,dtype=numpy.complex64) - data_i = numpy.zeros(shape=(ntime,nchan,npol,data_size,2), dtype=numpy.complex64) - data_i[:,:,:,:,0] = numpy.random.normal(0,1.0,size=(ntime,nchan,npol,data_size)) - data_i[:,:,:,:,1] = numpy.random.normal(0,1.0,size=(ntime,nchan,npol,data_size)) - data = 7*numpy.copy(data,order='C') - data = bifrost.ndarray(data_i[...,0] + 1j * data_i[...,1]) + data = bifrost.zeros(shape=ishape,dtype=numpy.complex64) + data.real[...] = numpy.random.normal(0,1.0,size=ishape) + data.imag[...] = numpy.random.normal(0,1.0,size=ishape) + data *= 7 if dtype not in (numpy.complex64, 'cf32'): data_quantized = bifrost.ndarray(shape=data.shape, dtype=dtype) quantize(data, data_quantized) @@ -132,9 +127,7 @@ def run_test(self, grid_size, illum_size, data_size, ntime, npol, nchan, polmajo illum_shape = (ntime,nchan,npol,data_size,illum_size,illum_size) # Create grid and illumination pattern - grid = numpy.zeros(shape=gridshape,dtype=otype) - grid = numpy.copy(grid,order='C') - grid = bifrost.ndarray(grid) + grid = bifrost.zeros(shape=gridshape,dtype=otype) illum = self._create_illum(illum_size, data_size, ntime, npol, nchan, dtype=otype) # Create data @@ -148,10 +141,10 @@ def run_test(self, grid_size, illum_size, data_size, ntime, npol, nchan, polmajo # Transpose for non pol-major kernels if not polmajor: - data=data.transpose((0,1,3,2)).copy() - locs=locs.transpose((0,1,2,4,3)).copy() - illum=illum.transpose((0,1,3,2,4,5)).copy() - + data = data.transpose((0,1,3,2)).copy() + locs = locs.transpose((0,1,2,4,3)).copy() + illum = illum.transpose((0,1,3,2,4,5)).copy() + grid = grid.copy(space='cuda') data = data.copy(space='cuda') illum = illum.copy(space='cuda') @@ -174,9 +167,7 @@ def run_kernel_test(self, grid_size, illum_size, data_size, ntime, npol, nchan, illum_shape = (ntime,nchan,npol,data_size,illum_size,illum_size) # Create grid and illumination pattern - grid = numpy.zeros(shape=gridshape,dtype=numpy.complex64) - grid = numpy.copy(grid,order='C') - grid = bifrost.ndarray(grid) + grid = bifrost.zeros(shape=gridshape,dtype=numpy.complex64) illum = self._create_illum(illum_size, data_size, ntime, npol, nchan) # Create data @@ -190,10 +181,10 @@ def run_kernel_test(self, grid_size, illum_size, data_size, ntime, npol, nchan, # Transpose for non pol-major kernels if not polmajor: - data=data.transpose((0,1,3,2)).copy() - locs=locs.transpose((0,1,2,4,3)).copy() - illum=illum.transpose((0,1,3,2,4,5)).copy() - + data = data.transpose((0,1,3,2)).copy() + locs = locs.transpose((0,1,2,4,3)).copy() + illum = illum.transpose((0,1,3,2,4,5)).copy() + grid = grid.copy(space='cuda') data = data.copy(space='cuda') illum = illum.copy(space='cuda') @@ -220,9 +211,7 @@ def run_positions_test(self, grid_size, illum_size, data_size, ntime, npol, ncha illum_shape = (ntime,nchan,npol,data_size,illum_size,illum_size) # Create grid and illumination pattern - grid = numpy.zeros(shape=gridshape,dtype=numpy.complex64) - grid = numpy.copy(grid,order='C') - grid = bifrost.ndarray(grid) + grid = bifrost.zeros(shape=gridshape,dtype=numpy.complex64) illum = self._create_illum(illum_size, data_size, ntime, npol, nchan) # Create data @@ -236,10 +225,10 @@ def run_positions_test(self, grid_size, illum_size, data_size, ntime, npol, ncha # Transpose for non pol-major kernels if not polmajor: - data=data.transpose((0,1,3,2)).copy() - locs=locs.transpose((0,1,2,4,3)).copy() - illum=illum.transpose((0,1,3,2,4,5)).copy() - + data = data.transpose((0,1,3,2)).copy() + locs = locs.transpose((0,1,2,4,3)).copy() + illum = illum.transpose((0,1,3,2,4,5)).copy() + grid = grid.copy(space='cuda') data = data.copy(space='cuda') illum = illum.copy(space='cuda') @@ -292,5 +281,3 @@ def test_set_positions_pm(self): self.run_positions_test(grid_size=64, illum_size=3, data_size=256, ntime=8, npol=3, nchan=2,polmajor=True) def test_set_positions(self): self.run_positions_test(grid_size=64, illum_size=3, data_size=256, ntime=8, npol=3, nchan=2,polmajor=False) - - diff --git a/test/test_scripts.py b/test/test_scripts.py index 9a75b08fa..baef30311 100644 --- a/test/test_scripts.py +++ b/test/test_scripts.py @@ -1,7 +1,6 @@ -#!/usr/bin/env python -# Copyright (c) 2019, The Bifrost Authors. All rights reserved. -# Copyright (c) 2019, The University of New Mexico. All rights reserved. +# Copyright (c) 2019-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2019-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -30,34 +29,39 @@ import unittest import os import re -import imp import sys import glob +try: + from io import StringIO +except ImportError: + from StringIO import StringIO + TEST_DIR = os.path.dirname(__file__) TOOLS_DIR = os.path.join(TEST_DIR, '..', 'tools') TESTBENCH_DIR = os.path.join(TEST_DIR, '..', 'testbench') -modInfoBuild = imp.find_module('bifrost', [os.path.join(TEST_DIR, '..', 'python')]) -BIFROST_DIR = os.path.abspath(modInfoBuild[1]) run_scripts_tests = False try: - from pylint import epylint as lint + from pylint.lint import Run + from pylint.reporters.text import TextReporter run_scripts_tests = True except ImportError: pass +run_scripts_tests &= (sys.version_info[0] >= 3) -_LINT_RE = re.compile('(?P.*?)\:(?P\d+)\: \[(?P.*?)\] (?P.*)') +_LINT_RE = re.compile('(?P.*?):(?P[0-9]+): \[(?P.*?)\] (?P.*)') @unittest.skipUnless(run_scripts_tests, "requires the 'pylint' module") class ScriptTest(unittest.TestCase): def _test_script(self, script): self.assertTrue(os.path.exists(script)) - out, err = lint.py_run("%s -E --extension-pkg-whitelist=numpy,scipy.fftpack --init-hook='import sys; sys.path=[%s]; sys.path.insert(0, \"%s\")'" % (script, ",".join(['"%s"' % p for p in sys.path]), os.path.dirname(BIFROST_DIR)), return_std=True) - out_lines = out.read().split('\n') - err_lines = err.read().split('\n') - out.close() - err.close() + + pylint_output = StringIO() + reporter = TextReporter(pylint_output) + Run([script, '-E', '--extension-pkg-whitelist=numpy'], reporter=reporter, exit=False) + out = pylint_output.getvalue() + out_lines = out.split('\n') for line in out_lines: #if line.find("Module 'numpy") != -1: diff --git a/test/test_scrunch.py b/test/test_scrunch.py index 8a6a3b7ea..332d09853 100644 --- a/test/test_scrunch.py +++ b/test/test_scrunch.py @@ -32,6 +32,8 @@ import bifrost.pipeline as bfp import bifrost.blocks as blocks +from bifrost.libbifrost_generated import BF_CUDA_ENABLED + class CallbackBlock(blocks.CopyBlock): """Testing-only block which calls user-defined functions on sequence and on data""" @@ -46,6 +48,7 @@ def on_data(self, ispan, ospan): self.data_callback(ispan, ospan) return super(CallbackBlock, self).on_data(ispan, ospan) +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TestScrunchBlock(unittest.TestCase): def setUp(self): """Create settings shared between tests""" diff --git a/test/test_serialize.py b/test/test_serialize.py index 09cfdb76e..4a60b7a95 100644 --- a/test/test_serialize.py +++ b/test/test_serialize.py @@ -34,15 +34,15 @@ import os import shutil +import tempfile class TemporaryDirectory(object): - def __init__(self, path): - self.path = path - os.makedirs(self.path) + def __init__(self): + self.path = tempfile.mkdtemp(suffix='.tmp', prefix='bifrost_test_') def remove(self): shutil.rmtree(self.path) def __enter__(self): - return self + return self.path def __exit__(self, type, value, tb): self.remove() @@ -51,18 +51,13 @@ def get_sigproc_file_size(filename): the whole file. """ with open(filename, 'rb') as f: - head = '' - while 'HEADER_END' not in head: + head = b'' + while b'HEADER_END' not in head: more_data = f.read(4096) - try: - more_data = more_data.decode(errors='replace') - except AttributeError: - # Python2 catch - pass if len(more_data) == 0: raise IOError("Not a valid sigproc file: " + filename) head += more_data - hdr_size = head.find('HEADER_END') + len('HEADER_END') + hdr_size = head.find(b'HEADER_END') + len(b'HEADER_END') file_size = os.path.getsize(filename) data_size = file_size - hdr_size return hdr_size, data_size @@ -71,10 +66,6 @@ def rename_sequence(hdr, name): hdr['name'] = name return hdr -def rename_sequence(hdr, name): - hdr['name'] = name - return hdr - class SerializeTest(unittest.TestCase): def setUp(self): self.fil_file = "./data/2chan16bitNoDM.fil" @@ -84,118 +75,126 @@ def setUp(self): with open(self.fil_file, 'rb') as f: self.data = f.read() self.data = self.data[hdr_size:] - self.temp_path = '/tmp/bifrost_test_serialize' self.basename = os.path.basename(self.fil_file) - self.basepath = os.path.join(self.temp_path, self.basename) self.gulp_nframe = 101 def run_test_serialize_with_name_no_ringlets(self, gulp_nframe_inc=0): - with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe, core=0) - for i in range(5): - if gulp_nframe_inc != 0: - data = copy(data, - gulp_nframe=self.gulp_nframe+i*gulp_nframe_inc) - else: - data = copy(data) - data = serialize(data, self.temp_path, core=0) - with TemporaryDirectory(self.temp_path): + with TemporaryDirectory() as temp_path: + with bf.Pipeline() as pipeline: + data = read_sigproc([self.fil_file], self.gulp_nframe, core=0) + for i in range(5): + if gulp_nframe_inc != 0: + data = copy(data, + gulp_nframe=self.gulp_nframe+i*gulp_nframe_inc) + else: + data = copy(data) + data = serialize(data, temp_path, core=0) + pipeline.run() - # Note: SerializeBlock uses os.path.basename if path is given - hdrpath = self.basepath + '.bf.json' - datpath = self.basepath + '.bf.' + '0' * 12 + '.dat' - self.assertTrue(os.path.exists(hdrpath)) - self.assertTrue(os.path.exists(datpath)) - self.assertEqual(os.path.getsize(datpath), self.data_size) - with open(datpath, 'rb') as f: - data = f.read() - self.assertEqual(data, self.data) + + # Note: SerializeBlock uses os.path.basename if path is given + basepath = os.path.join(temp_path, self.basename) + hdrpath = basepath + '.bf.json' + datpath = basepath + '.bf.' + '0' * 12 + '.dat' + self.assertTrue(os.path.exists(hdrpath)) + self.assertTrue(os.path.exists(datpath)) + self.assertEqual(os.path.getsize(datpath), self.data_size) + with open(datpath, 'rb') as f: + data = f.read() + self.assertEqual(data, self.data) def test_serialize_with_name_no_ringlets(self): self.run_test_serialize_with_name_no_ringlets() self.run_test_serialize_with_name_no_ringlets(gulp_nframe_inc=1) self.run_test_serialize_with_name_no_ringlets(gulp_nframe_inc=3) def test_serialize_with_time_tag_no_ringlets(self): - with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe) - # Custom view sets sequence name to '', which causes SerializeBlock - # to use the time_tag instead. - data = bf.views.custom(data, lambda hdr: rename_sequence(hdr, '')) - data = serialize(data, self.temp_path) - with TemporaryDirectory(self.temp_path): + with TemporaryDirectory() as temp_path: + with bf.Pipeline() as pipeline: + data = read_sigproc([self.fil_file], self.gulp_nframe) + # Custom view sets sequence name to '', which causes SerializeBlock + # to use the time_tag instead. + data = bf.views.custom(data, lambda hdr: rename_sequence(hdr, '')) + data = serialize(data, temp_path) pipeline.run() - basepath = os.path.join(self.temp_path, - '%020i' % self.time_tag) - hdrpath = basepath + '.bf.json' - datpath = basepath + '.bf.' + '0' * 12 + '.dat' - self.assertTrue(os.path.exists(hdrpath)) - self.assertTrue(os.path.exists(datpath)) - self.assertEqual(os.path.getsize(datpath), self.data_size) - with open(datpath, 'rb') as f: - data = f.read() - self.assertEqual(data, self.data) + + basepath = os.path.join(temp_path, '%020i' % self.time_tag) + hdrpath = basepath + '.bf.json' + datpath = basepath + '.bf.' + '0' * 12 + '.dat' + self.assertTrue(os.path.exists(hdrpath)) + self.assertTrue(os.path.exists(datpath)) + self.assertEqual(os.path.getsize(datpath), self.data_size) + with open(datpath, 'rb') as f: + data = f.read() + self.assertEqual(data, self.data) def test_serialize_with_name_and_ringlets(self): - with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe) - # Transpose so that freq becomes a ringlet dimension - # TODO: Test multiple ringlet dimensions (e.g., freq + pol) once - # SerializeBlock supports it. - data = transpose(data, ['freq', 'time', 'pol']) - data = serialize(data, self.temp_path) - with TemporaryDirectory(self.temp_path): + with TemporaryDirectory() as temp_path: + with bf.Pipeline() as pipeline: + data = read_sigproc([self.fil_file], self.gulp_nframe) + # Transpose so that freq becomes a ringlet dimension + # TODO: Test multiple ringlet dimensions (e.g., freq + pol) once + # SerializeBlock supports it. + data = transpose(data, ['freq', 'time', 'pol']) + data = serialize(data, temp_path) pipeline.run() - # Note: SerializeBlock uses os.path.basename if path is given - hdrpath = self.basepath + '.bf.json' - datpath0 = self.basepath + '.bf.' + '0' * 12 + '.0.dat' - datpath1 = self.basepath + '.bf.' + '0' * 12 + '.1.dat' - self.assertTrue(os.path.exists(hdrpath)) - self.assertTrue(os.path.exists(datpath0)) - self.assertTrue(os.path.exists(datpath1)) - self.assertEqual(os.path.getsize(datpath0), - self.data_size // 2) - self.assertEqual(os.path.getsize(datpath1), - self.data_size // 2) + + # Note: SerializeBlock uses os.path.basename if path is given + basepath = os.path.join(temp_path, self.basename) + hdrpath = basepath + '.bf.json' + datpath0 = basepath + '.bf.' + '0' * 12 + '.0.dat' + datpath1 = basepath + '.bf.' + '0' * 12 + '.1.dat' + self.assertTrue(os.path.exists(hdrpath)) + self.assertTrue(os.path.exists(datpath0)) + self.assertTrue(os.path.exists(datpath1)) + self.assertEqual(os.path.getsize(datpath0), + self.data_size // 2) + self.assertEqual(os.path.getsize(datpath1), + self.data_size // 2) def test_deserialize_no_ringlets(self): - with TemporaryDirectory(self.temp_path): + with TemporaryDirectory() as temp_path: with bf.Pipeline() as pipeline: data = read_sigproc([self.fil_file], self.gulp_nframe) - serialize(data, self.temp_path) + serialize(data, temp_path) pipeline.run() - datpath = self.basepath + '.bf.' + '0' * 12 + '.dat' + + datpath = os.path.join(temp_path, self.basename) + '.bf.' + '0' * 12 + '.dat' with bf.Pipeline() as pipeline: - data = deserialize([self.basepath + '.bf'], self.gulp_nframe) + data = deserialize([os.path.join(temp_path, self.basename) + '.bf'], self.gulp_nframe) # Note: Must rename the sequence to avoid overwriting the input # file. data = bf.views.custom( data, lambda hdr: rename_sequence(hdr, hdr['name'] + '.2')) - serialize(data, self.temp_path) + serialize(data, temp_path) pipeline.run() - datpath = self.basepath + '.2.bf.' + '0' * 12 + '.dat' - with open(datpath, 'rb') as f: - data = f.read() - self.assertEqual(len(data), len(self.data)) - self.assertEqual(data, self.data) + + datpath = os.path.join(temp_path, self.basename) + '.2.bf.' + '0' * 12 + '.dat' + with open(datpath, 'rb') as f: + data = f.read() + self.assertEqual(len(data), len(self.data)) + self.assertEqual(data, self.data) def test_deserialize_with_ringlets(self): - with TemporaryDirectory(self.temp_path): + with TemporaryDirectory() as temp_path: with bf.Pipeline() as pipeline: data = read_sigproc([self.fil_file], self.gulp_nframe) data = transpose(data, ['freq', 'time', 'pol']) - serialize(data, self.temp_path) + serialize(data, temp_path) pipeline.run() - datpath = self.basepath + '.bf.' + '0' * 12 + '.dat' + + datpath = os.path.join(temp_path, self.basename) + '.bf.' + '0' * 12 + '.dat' with bf.Pipeline() as pipeline: - data = deserialize([self.basepath + '.bf'], self.gulp_nframe) + data = deserialize([os.path.join(temp_path, self.basename) + '.bf'], self.gulp_nframe) # Note: Must rename the sequence to avoid overwriting the input # file. data = bf.views.custom( data, lambda hdr: rename_sequence(hdr, hdr['name'] + '.2')) - serialize(data, self.temp_path) + serialize(data, temp_path) pipeline.run() - hdrpath = self.basepath + '.2.bf.json' - datpath0 = self.basepath + '.2.bf.' + '0' * 12 + '.0.dat' - datpath1 = self.basepath + '.2.bf.' + '0' * 12 + '.1.dat' - self.assertTrue(os.path.exists(hdrpath)) - self.assertTrue(os.path.exists(datpath0)) - self.assertTrue(os.path.exists(datpath1)) - self.assertEqual(os.path.getsize(datpath0), - self.data_size // 2) - self.assertEqual(os.path.getsize(datpath1), - self.data_size // 2) + + basepath = os.path.join(temp_path, self.basename) + hdrpath = basepath + '.2.bf.json' + datpath0 = basepath + '.2.bf.' + '0' * 12 + '.0.dat' + datpath1 = basepath + '.2.bf.' + '0' * 12 + '.1.dat' + self.assertTrue(os.path.exists(hdrpath)) + self.assertTrue(os.path.exists(datpath0)) + self.assertTrue(os.path.exists(datpath1)) + self.assertEqual(os.path.getsize(datpath0), + self.data_size // 2) + self.assertEqual(os.path.getsize(datpath1), + self.data_size // 2) diff --git a/test/test_sigproc.py b/test/test_sigproc.py index f75e17357..7216d43cd 100644 --- a/test/test_sigproc.py +++ b/test/test_sigproc.py @@ -136,11 +136,13 @@ def test_append_data(self): random_stream = np.random.randint(63, size=10000).astype('uint8').T testfile.append_data(random_stream) self.assertEqual(testfile.data.shape[0], initial_nframe + 10000) + testfile.close() def test_data_slice(self): testFile = SigprocFile() testFile.open(filename='./data/1chan8bitNoDM.fil', mode='r+b') testFile.read_header() self.assertEqual(testFile.read_data(-1).shape, (1, 1, 1)) + testFile.close() def test_append_untransposed_data(self): """test if appending data in different shape affects output""" initial_nframe = self.my8bitfile.get_nframe() @@ -161,6 +163,8 @@ def test_append_untransposed_data(self): testfile1.open(filename='./data/test_write1.fil', mode='rb') testfile2.open(filename='./data/test_write1.fil', mode='rb') np.testing.assert_array_equal(testfile1.read_data(), testfile2.read_data()) + testfile1.close() + testfile2.close() class Test_16bit_2chan(unittest.TestCase): def setUp(self): self.my16bitfile = SigprocFile() @@ -187,6 +191,8 @@ def test_append_2chan_data(self): file2.read_header() file2.read_data() np.testing.assert_array_equal(file1.read_data(),file2.read_data()) + file1.close() + file2.close() class Test_data_slicing(unittest.TestCase): def setUp(self): self.myfile = SigprocFile() diff --git a/test/test_transpose.py b/test/test_transpose.py index b83d90c92..ab7906ae6 100644 --- a/test/test_transpose.py +++ b/test/test_transpose.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,18 +28,28 @@ import unittest import numpy as np import bifrost as bf -import bifrost.transpose from functools import reduce from itertools import permutations +from bifrost.libbifrost_generated import BF_CUDA_ENABLED, BF_FLOAT128_ENABLED + +_FIRST_TEST = True + +@unittest.skipUnless(BF_CUDA_ENABLED, "requires GPU support") class TransposeTest(unittest.TestCase): + # TODO: @classmethod; def setUpClass(kls) + def setUp(self): + global _FIRST_TEST + if _FIRST_TEST: + bf.clear_map_cache() + _FIRST_TEST = False def run_simple_test(self, axes, dtype, shape): n = reduce(lambda a,b:a*b, shape) idata = (np.arange(n).reshape(shape) % 251).astype(dtype) odata_gold = idata.transpose(axes) iarray = bf.ndarray(idata, space='cuda') oarray = bf.empty_like(iarray.transpose(axes)) - bf.transpose.transpose(oarray, iarray, axes) + bf.transpose(oarray, iarray, axes) oarray = oarray.copy('system') np.testing.assert_array_equal(oarray, odata_gold) @@ -47,7 +57,9 @@ def run_simple_test_shmoo(self, dtype): for perm in permutations(range(3)): for shape in [(23,37,51), (100, 200, 2), - (2, 200, 100)]: + (2, 200, 100), + (100, 200, 1), + (1, 200, 100)]: self.run_simple_test(perm, dtype, shape) def test_1byte(self): self.run_simple_test_shmoo(np.uint8) @@ -57,5 +69,6 @@ def test_4byte(self): self.run_simple_test_shmoo(np.uint32) def test_8byte(self): self.run_simple_test_shmoo(np.uint64) + @unittest.skipUnless(BF_FLOAT128_ENABLED, "requires float128 support") def test_16byte(self): self.run_simple_test_shmoo(np.float128) diff --git a/test/test_tutorial.py b/test/test_tutorial.py new file mode 100644 index 000000000..767b2b7d2 --- /dev/null +++ b/test/test_tutorial.py @@ -0,0 +1,159 @@ + +# Copyright (c) 2021-2023, The Bifrost Authors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" +Unit tests for the various Bifrost tutorial notebooks. +""" + +import unittest +import glob +import sys +import re +import os +from tempfile import mkdtemp +from shutil import rmtree + + +run_tutorial_tests = False +try: + import jupyter_client + import nbformat + from nbconvert.preprocessors import ExecutePreprocessor + run_tutorial_tests = True +except ImportError: + pass + + +__version__ = "0.1" +__author__ = "Jayce Dowell" + + +def run_notebook(notebook_path, run_path=None, kernel_name=None): + """ + From: + http://www.blog.pythonlibrary.org/2018/10/16/testing-jupyter-notebooks/ + """ + + nb_name, _ = os.path.splitext(os.path.basename(notebook_path)) + dirname = os.path.dirname(notebook_path) + + with open(notebook_path, encoding='utf-8') as f: + nb = nbformat.read(f, as_version=4) + + cleanup = False + if run_path is None: + run_path = mkdtemp(prefix='test-tutorial-', suffix='.tmp') + cleanup = True + + proc = ExecutePreprocessor(timeout=600, kernel_name=kernel_name) + proc.allow_errors = True + + proc.preprocess(nb, {'metadata': {'path': run_path}}) + output_path = os.path.join(dirname, '{}_all_output.ipynb'.format(nb_name)) + + with open(output_path, mode='wt', encoding='utf-8') as f: + nbformat.write(nb, f) + errors = [] + for cell in nb.cells: + if 'outputs' in cell: + for output in cell['outputs']: + if output.output_type == 'error': + errors.append(output) + + if cleanup: + try: + rmtree(run_path) + except OSError: + pass + + return nb, errors + + +@unittest.skipUnless(run_tutorial_tests, "requires the 'nbformat' and 'nbconvert' modules") +class tutorial_tests(unittest.TestCase): + """A unittest.TestCase collection of unit tests for the Bifrost tutorial notebooks.""" + + def setUp(self): + self.maxDiff = 8192 + + self._kernel = jupyter_client.KernelManager() + self._kernel.start_kernel() + self.kernel_name = self._kernel.kernel_name + + def tearDown(self): + self._kernel.shutdown_kernel() + self.kernel_name = None + + +def _test_generator(notebook): + """ + Function to build a test method for each notebook that is provided. + Returns a function that is suitable as a method inside a unittest.TestCase + class + """ + + def test(self): + nb, errors = run_notebook(notebook, kernel_name=self.kernel_name) + + message = '' + if len(errors) > 0: + for error in errors: + message += '%s: %s\n' % (error['ename'], error['evalue']) + for line in error['traceback']: + message += ' %s\n' % line + self.assertEqual(errors, [], message) + + return test + + +_NOTEBOOKS = glob.glob(os.path.join(os.path.dirname(__file__), '..', 'tutorial', '*.ipynb')) +_NOTEBOOKS.sort() +for notebook in _NOTEBOOKS: + if notebook.find('06_data_capture') != -1: + # Skip this for now + continue + test = _test_generator(notebook) + name = 'test_%s' % os.path.splitext(os.path.basename(notebook))[0].replace(' ', '_') + doc = """Execution of the '%s' notebook.""" % os.path.basename(notebook) + setattr(test, '__doc__', doc) + setattr(tutorial_tests, name, test) + + +class tutorial_test_suite(unittest.TestSuite): + """A unittest.TestSuite class which contains all of the Bifrost tutorial + notebook tests.""" + + def __init__(self): + unittest.TestSuite.__init__(self) + + loader = unittest.TestLoader() + self.addTests(loader.loadTestsFromTestCase(tutorial_tests)) + + +if __name__ == '__main__': + unittest.main() + diff --git a/test/test_udp_io.py b/test/test_udp_io.py new file mode 100644 index 000000000..0e0897377 --- /dev/null +++ b/test/test_udp_io.py @@ -0,0 +1,671 @@ +# Copyright (c) 2019-2024, The Bifrost Authors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Bifrost Authors nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import unittest +import os +import json +import time +import ctypes +import threading +import bifrost as bf +import datetime +from contextlib import closing +from bifrost.ring import Ring +from bifrost.address import Address +from bifrost.udp_socket import UDPSocket +from bifrost.packet_writer import HeaderInfo, UDPTransmit +from bifrost.packet_capture import PacketCaptureCallback, UDPCapture +from bifrost.quantize import quantize +import numpy as np + +class AccumulateOp(object): + def __init__(self, ring, output_timetags, output_data, size, dtype=np.uint8): + self.ring = ring + self.output_timetags = output_timetags + self.output_data = output_data + self.size = size*(dtype().nbytes) + self.dtype = dtype + + def main(self): + for iseq in self.ring.read(guarantee=True): + self.output_timetags.append(iseq.time_tag) + self.output_data.append([]) + + iseq_spans = iseq.read(self.size) + while not self.ring.writing_ended(): + for ispan in iseq_spans: + idata = ispan.data_view(self.dtype) + self.output_data[-1].append(idata.copy()) + +class BaseUDPIOTest(object): + class BaseUDPIOTestCase(unittest.TestCase): + def setUp(self): + """Generate some dummy data to read""" + # Generate test vector and save to file + t = np.arange(256*4096*2) + w = 0.2 + self.s0 = 5*np.cos(w * t, dtype='float32') \ + + 3j*np.sin(w * t, dtype='float32') + + +class TBNReader(object): + def __init__(self, sock, ring, nsrc=32): + self.sock = sock + self.ring = ring + self.nsrc = nsrc + def callback(self, seq0, time_tag, decim, chan0, nsrc, hdr_ptr, hdr_size_ptr): + #print "++++++++++++++++ seq0 =", seq0 + #print " time_tag =", time_tag + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'cfreq': 196e6 * chan0/2.**32, + 'bw': 196e6/decim, + 'nstand': nsrc/2, + 'npol': 2, + 'complex': True, + 'nbit': 8} + #print "******** CFREQ:", hdr['cfreq'] + try: + hdr_str = json.dumps(hdr).encode() + except AttributeError: + # Python2 catch + pass + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_tbn(self.callback) + with UDPCapture("tbn", self.sock, self.ring, self.nsrc, 0, 9000, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class TBNUDPIOTest(BaseUDPIOTest.BaseUDPIOTestCase): + """Test simple IO for the UDP-based TBN packet reader and writing""" + def _get_data(self): + # Setup the packet HeaderInfo + hdr_desc = HeaderInfo() + hdr_desc.set_tuning(int(round(74e6 / 196e6 * 2**32))) + hdr_desc.set_gain(20) + + # Reorder as packets, stands, time + data = self.s0.reshape(512,32,-1) + data = data.transpose(2,1,0).copy() + # Convert to ci8 for TBN + data_q = bf.ndarray(shape=data.shape, dtype='ci8') + quantize(data, data_q, scale=10) + + # Update the number of data sources and return + hdr_desc.set_nsrc(data_q.shape[1]) + return 1, hdr_desc, data_q + def test_write(self): + addr = Address('127.0.0.1', 7147) + with closing(UDPSocket()) as sock: + sock.connect(addr) + op = UDPTransmit('tbn', sock) + + # Get TBN data + timetag0, hdr_desc, data = self._get_data() + + # Go! + op.send(hdr_desc, timetag0, 1960*512, 0, 1, data) + def test_read(self): + # Setup the ring + ring = Ring(name="capture_tbn") + + # Setup the blocks + addr = Address('127.0.0.1', 7147) + ## Output via UDPTransmit + with closing(UDPSocket()) as osock: + osock.connect(addr) + oop = UDPTransmit('tbn', osock) + ## Input via UDPCapture + with closing(UDPSocket()) as isock: + isock.bind(addr) + isock.timeout = 0.1 + iop = TBNReader(isock, ring, nsrc=32) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 32*512*2) + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get TBN data and send it off + timetag0, hdr_desc, data = self._get_data() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*1960*512, 1960*512, 0, 1, data[[p],...]) + time.sleep(0.001) + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Loop over sequences + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,512,32,2) + seq_data = seq_data.transpose(0,2,1,3).copy() + ## Drop the last axis (complexity) since we are going to ci8 + seq_data = bf.ndarray(shape=seq_data.shape[:-1], dtype='ci8', buffer=seq_data.ctypes.data) + + ## Ignore the first set of packets + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + def test_write_multicast(self): + addr = Address('224.0.0.251', 7147) + with closing(UDPSocket()) as sock: + sock.connect(addr) + op = UDPTransmit('tbn', sock) + + # Get TBN data + timetag0, hdr_desc, data = self._get_data() + + # Go! + op.send(hdr_desc, timetag0, 1960*512, 0, 1, data) + def test_read_multicast(self): + # Setup the ring + ring = Ring(name="capture_multi") + + # Setup the blocks + addr = Address('224.0.0.251', 7147) + ## Output via UDPTransmit + with closing(UDPSocket()) as osock: + osock.connect(addr) + oop = UDPTransmit('tbn', osock) + ## Input via UDPCapture + with closing(UDPSocket()) as isock: + isock.bind(addr) + isock.timeout = 0.1 + iop = TBNReader(isock, ring, nsrc=32) + # Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 32*512*2) + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get TBN data and send it off + timetag0, hdr_desc, data = self._get_data() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*1960*512, 1960*512, 0, 1, data[[p],...]) + time.sleep(0.001) + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Loop over sequences + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,512,32,2) + seq_data = seq_data.transpose(0,2,1,3).copy() + ## Drop the last axis (complexity) since we are going to ci8 + seq_data = bf.ndarray(shape=seq_data.shape[:-1], dtype='ci8', buffer=seq_data.ctypes.data) + + ## Ignore the first set of packets + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + + +class DRXReader(object): + def __init__(self, sock, ring, nsrc=4): + self.sock = sock + self.ring = ring + self.nsrc = nsrc + def callback(self, seq0, time_tag, decim, chan0, chan1, nsrc, hdr_ptr, hdr_size_ptr): + #print "++++++++++++++++ seq0 =", seq0 + #print " time_tag =", time_tag + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'chan1': chan1, + 'cfreq0': 196e6 * chan0/2.**32, + 'cfreq1': 196e6 * chan1/2.**32, + 'bw': 196e6/decim, + 'nstand': nsrc/2, + 'npol': 2, + 'complex': True, + 'nbit': 4} + #print "******** CFREQ:", hdr['cfreq'] + try: + hdr_str = json.dumps(hdr).encode() + except AttributeError: + # Python2 catch + pass + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_drx(self.callback) + with UDPCapture("drx", self.sock, self.ring, self.nsrc, 0, 9000, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class DRXUDPIOTest(BaseUDPIOTest.BaseUDPIOTestCase): + """Test simple IO for the UDP-based DRX packet reader and writing""" + def _get_data(self): + # Setup the packet HeaderInfo + hdr_desc = HeaderInfo() + hdr_desc.set_decimation(10) + hdr_desc.set_tuning(int(round(74e6 / 196e6 * 2**32))) + + # Reorder as packets, beams, time + data = self.s0.reshape(4096,4,-1) + data = data.transpose(2,1,0).copy() + # Convert to ci4 for DRX + data_q = bf.ndarray(shape=data.shape, dtype='ci4') + quantize(data, data_q) + + # Update the number of data sources and return + hdr_desc.set_nsrc(data_q.shape[1]) + return 1, hdr_desc, data_q + def test_write(self): + addr = Address('127.0.0.1', 7147) + with closing(UDPSocket()) as sock: + sock.connect(addr) + op = UDPTransmit('drx', sock) + + # Get TBN data + timetag0, hdr_desc, data = self._get_data() + + # Go! + op.send(hdr_desc, timetag0, 10*4096, (1<<3), 128, data) + def test_read(self): + # Setup the ring + ring = Ring(name="capture_drx") + + # Setup the blocks + addr = Address('127.0.0.1', 7147) + ## Output via UDPTransmit + with closing(UDPSocket()) as osock: + osock.connect(addr) + oop = UDPTransmit('drx', osock) + ## Input via UDPCapture + with closing(UDPSocket()) as isock: + isock.bind(addr) + isock.timeout = 0.1 + iop = DRXReader(isock, ring, nsrc=4) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 4*4096*1) + + # Start the reader + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get DRX data and send it off + timetag0, hdr_desc, data = self._get_data() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*10*4096, 10*4096, (1<<3), 128, data[p,[0,1],...].reshape(1,2,4096)) + oop.send(hdr_desc, timetag0+p*10*4096, 10*4096, (2<<3), 128, data[p,[2,3],...].reshape(1,2,4096)) + time.sleep(0.001) + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Reorder to match what we sent out + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,4096,4) + seq_data = seq_data.transpose(0,2,1).copy() + seq_data = bf.ndarray(shape=seq_data.shape, dtype='ci4', buffer=seq_data.ctypes.data) + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + def test_write_single(self): + addr = Address('127.0.0.1', 7147) + with closing(UDPSocket()) as sock: + sock.connect(addr) + op = UDPTransmit('drx', sock) + + # Get DRX data + timetag0, hdr_desc, data = self._get_data() + hdr_desc.set_nsrc(2) + data = data[:,[0,1],:].copy() + + # Go! + op.send(hdr_desc, timetag0, 10*4096, (1<<3), 128, data) + def test_read_single(self): + # Setup the ring + ring = Ring(name="capture_drx_single") + + # Setup the blocks + addr = Address('127.0.0.1', 7147) + ## Output via UDPTransmit + with closing(UDPSocket()) as osock: + osock.connect(addr) + oop = UDPTransmit('drx', osock) + ## Input via UDPCapture + with closing(UDPSocket()) as isock: + isock.bind(addr) + isock.timeout = 0.1 + iop = DRXReader(isock, ring, nsrc=2) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 2*4096*1) + + # Start the reader + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get DRX data and send it off + timetag0, hdr_desc, data = self._get_data() + data = data[:,[0,1],:].copy() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*10*4096, 10*4096, (1<<3), 128, data[[p],...]) + time.sleep(0.001) + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Reorder to match what we sent out + seq_data = np.array(seq_data, dtype=np.uint8) + seq_data = seq_data.reshape(-1,4096,2) + seq_data = seq_data.transpose(0,2,1).copy() + seq_data = bf.ndarray(shape=seq_data.shape, dtype='ci4', buffer=seq_data.ctypes.data) + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + + +class PBeamReader(object): + def __init__(self, sock, ring, nsrc=1): + self.sock = sock + self.ring = ring + self.nsrc = nsrc + def callback(self, seq0, time_tag, navg, chan0, nchan, nbeam, hdr_ptr, hdr_size_ptr): + #print "++++++++++++++++ seq0 =", seq0 + #print " time_tag =", time_tag + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'cfreq0': chan0*(196e6/8192), + 'bw': nchan*(196e6/8192), + 'navg': navg, + 'nbeam': nbeam, + 'npol': 4, + 'complex': False, + 'nbit': 32} + #print("******** HDR:", hdr) + try: + hdr_str = json.dumps(hdr).encode() + except AttributeError: + # Python2 catch + pass + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_pbeam(self.callback) + with UDPCapture("pbeam", self.sock, self.ring, self.nsrc, 1, 9000, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + +class PBeamUDPIOTest(BaseUDPIOTest.BaseUDPIOTestCase): + """Test simple IO for the UDP-based PBeam packet reader and writing""" + def _get_data(self): + # Setup the packet HeaderInfo + hdr_desc = HeaderInfo() + hdr_desc.set_tuning(1) + hdr_desc.set_chan0(345) + hdr_desc.set_nchan(128) + hdr_desc.set_decimation(24) + + # Reorder as packets, beam, chan/pol + data = self.s0.reshape(128*4,1,-1) + data = data.transpose(2,1,0) + data = data.real[:1024,...].copy() + + # Update the number of data sources and return + hdr_desc.set_nsrc(data.shape[1]) + return 1, hdr_desc, data + def test_write(self): + addr = Address('127.0.0.1', 7147) + with closing(UDPSocket()) as sock: + sock.connect(addr) + op = UDPTransmit('pbeam1_128', sock) + + # Get PBeam data + timetag0, hdr_desc, data = self._get_data() + + # Go! + op.send(hdr_desc, timetag0, 24, 0, 1, data) + def test_read(self): + # Setup the ring + ring = Ring(name="capture_pbeam") + + # Setup the blocks + addr = Address('127.0.0.1', 7147) + ## Output via UDPTransmit + with closing(UDPSocket()) as osock: + osock.connect(addr) + oop = UDPTransmit('pbeam1_128', osock) + ## Input via UDPCapture + with closing(UDPSocket()) as isock: + isock.bind(addr) + isock.timeout = 0.1 + iop = PBeamReader(isock, ring, nsrc=1) + ## Data accumulation + times = [] + final = [] + aop = AccumulateOp(ring, times, final, 1*128*4, dtype=np.float32) + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get PBeam data and send it off + timetag0, hdr_desc, data = self._get_data() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*24, 24, 0, 1, data[[p],...]) + time.sleep(0.001) + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + ## Reorder to match what we sent out + seq_data = np.array(seq_data, dtype=np.float32) + seq_data = seq_data.reshape(-1,128*4,1) + seq_data = seq_data.transpose(0,2,1).copy() + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop + + +start_pipeline = datetime.datetime.now() + +class SIMPLEReader(object): + def __init__(self, sock, ring): + self.sock = sock + self.ring = ring + self.nsrc = 1 + def seq_callback(self, seq0, chan0, nchan, nsrc, + time_tag_ptr, hdr_ptr, hdr_size_ptr): + FS = 196.0e6 + CHAN_BW = 1e3 + # timestamp0 = (self.utc_start - ADP_EPOCH).total_seconds() + # time_tag0 = timestamp0 * int(FS) + time_tag = int((datetime.datetime.now() - start_pipeline).total_seconds()*1e6) + time_tag_ptr[0] = time_tag + cfreq = 55e6 + hdr = {'time_tag': time_tag, + 'seq0': seq0, + 'chan0': chan0, + 'nchan': nchan, + 'cfreq': cfreq, + 'bw': CHAN_BW, + 'nstand': 2, + #'stand0': src0*16, # TODO: Pass src0 to the callback too(?) + 'npol': 2, + 'complex': True, + 'nbit': 16} + hdr_str = json.dumps(hdr).encode() + # TODO: Can't pad with NULL because returned as C-string + #hdr_str = json.dumps(hdr).ljust(4096, '\0') + #hdr_str = json.dumps(hdr).ljust(4096, ' ') + self.header_buf = ctypes.create_string_buffer(hdr_str) + hdr_ptr[0] = ctypes.cast(self.header_buf, ctypes.c_void_p) + hdr_size_ptr[0] = len(hdr_str) + return 0 + def main(self): + seq_callback = PacketCaptureCallback() + seq_callback.set_simple(self.seq_callback) + with UDPCapture("simple" , self.sock, self.ring, self.nsrc, 0, 9000, 16, 128, + sequence_callback=seq_callback) as capture: + while True: + status = capture.recv() + if status in (1,4,5,6): + break + del capture + + +class SimpleUDPIOTest(BaseUDPIOTest.BaseUDPIOTestCase): + """Test simple IO for the UDP-based Simple packet reader and writing""" + def _get_data(self): + hdr_desc = HeaderInfo() + + # Reorder as packets, stands, time + data = self.s0.reshape(2048,1,-1) + data = data.transpose(2,1,0).copy() + # Convert to ci16 for simple + data_q = bf.ndarray(shape=data.shape, dtype='ci16') + quantize(data, data_q, scale=10) + + return 128, hdr_desc, data_q + + def test_write(self): + addr = Address('127.0.0.1', 7147) + with closing(UDPSocket()) as sock: + sock.connect(addr) + # Get simple data + op = UDPTransmit('simple', sock) + + timetag0, hdr_desc, data = self._get_data() + # Go! + op.send(hdr_desc, timetag0, 1, 0, 1, data) + + def test_read(self): + # Setup the ring + ring = Ring(name="capture_simple") + + # Setup the blocks + addr = Address('127.0.0.1', 7147) + ## Output via UDPTransmit + with closing(UDPSocket()) as osock: + osock.connect(addr) + oop = UDPTransmit('simple', osock) + ## Input via UDPCapture + with closing(UDPSocket()) as isock: + isock.bind(addr) + isock.timeout = 1.0 + iop = SIMPLEReader(isock, ring) + ## Data accumulation + times = [] + final = [] + expectedsize = 1*2048*4 + aop = AccumulateOp(ring, times, final, expectedsize, dtype=np.int16) + + + # Start the reader and accumlator threads + reader = threading.Thread(target=iop.main) + accumu = threading.Thread(target=aop.main) + reader.start() + accumu.start() + + # Get simple data and send it off + timetag0, hdr_desc, data = self._get_data() + for p in range(data.shape[0]): + oop.send(hdr_desc, timetag0+p*1, 1, 0, 1, data[[p],...]) + time.sleep(0.001) + reader.join() + accumu.join() + + # Compare + for seq_timetag,seq_data in zip(times, final): + seq_data = np.array(seq_data, dtype=np.uint16) + seq_data = seq_data.reshape(-1,2048,1,2) + seq_data = seq_data.transpose(0,2,1,3).copy() + ## Drop the last axis (complexity) since we are going to ci16 + seq_data = bf.ndarray(shape=seq_data.shape[:-1], dtype='ci16', buffer=seq_data.ctypes.data) + + np.testing.assert_equal(seq_data[1:,...], data[1:,...]) + + # Clean up + del oop diff --git a/test/test_unpack.py b/test/test_unpack.py index d487312be..adaf0bccc 100644 --- a/test/test_unpack.py +++ b/test/test_unpack.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ import unittest import numpy as np import bifrost as bf -import bifrost.unpack class UnpackTest(unittest.TestCase): def run_unpack_to_ci8_test(self, iarray): @@ -37,7 +36,7 @@ def run_unpack_to_ci8_test(self, iarray): [(4, 5), (6, 7)], [(-8, -7), (-6, -5)]], dtype='ci8') - bf.unpack.unpack(iarray, oarray) + bf.unpack(iarray, oarray) np.testing.assert_equal(oarray, oarray_known) def test_ci4_to_ci8(self): iarray = bf.ndarray([[(0x10,),(0x32,)], @@ -70,7 +69,7 @@ def run_unpack_to_cf32_test(self, iarray): [ 4+5j, 6+7j], [-8-7j, -6-5j]], dtype='cf32') - bf.unpack.unpack(iarray, oarray) + bf.unpack(iarray, oarray) np.testing.assert_equal(oarray, oarray_known) def test_ci4_to_cf32(self): iarray = bf.ndarray([[(0x10,),(0x32,)], diff --git a/test/test_version.py b/test/test_version.py new file mode 100644 index 000000000..4ab08501e --- /dev/null +++ b/test/test_version.py @@ -0,0 +1,10 @@ +import unittest +import subprocess +import sys + +class TestVersion(unittest.TestCase): + def test_plain_version(self): + subprocess.check_output([sys.executable, '-m', 'bifrost.version']) + + def test_version_config(self): + subprocess.check_output([sys.executable, '-m', 'bifrost.version', '--config']) diff --git a/test/travis.sh b/test/travis.sh deleted file mode 100755 index b7339bdeb..000000000 --- a/test/travis.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# This file runs CPU-safe tests for travis-ci -./download_test_data.sh -export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} -python -c "from bifrost import telemetry; telemetry.disable()" -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline -m unittest \ - test_block \ - test_sigproc \ - test_resizing \ - test_quantize \ - test_unpack \ - test_print_header \ - test_pipeline_cpu \ - test_serialize \ - test_binary_io \ - test_address \ - test_scripts diff --git a/testbench/download_breakthrough_listen_data.py b/testbench/download_breakthrough_listen_data.py index d8127a43d..453b3861f 100755 --- a/testbench/download_breakthrough_listen_data.py +++ b/testbench/download_breakthrough_listen_data.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -32,12 +32,6 @@ Generate test data that can be used with a testbench """ -# Python2 compatibility -from __future__ import print_function -import sys -if sys.version_info < (3,): - input = raw_input - import os import sys import numpy as np diff --git a/testbench/generate_test_data.py b/testbench/generate_test_data.py index 14d69820f..68afca384 100755 --- a/testbench/generate_test_data.py +++ b/testbench/generate_test_data.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -32,9 +32,6 @@ Generate test data that can be used with a testbench """ -# Python2 compatibility -from __future__ import print_function - import os import numpy as np diff --git a/testbench/gpuspec_simple.py b/testbench/gpuspec_simple.py index c0e3733a1..836efaf36 100755 --- a/testbench/gpuspec_simple.py +++ b/testbench/gpuspec_simple.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,9 +26,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import bifrost as bf from argparse import ArgumentParser diff --git a/testbench/jenkins.sh b/testbench/jenkins.sh deleted file mode 100755 index d1e8924d1..000000000 --- a/testbench/jenkins.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Part 1 - Synthetic data -## Create -python generate_test_data.py -## Use -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_file_read_write.py -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_fft.py -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline your_first_block.py - -# Part 2 - Real data -## Download -python download_breakthrough_listen_data.py -y -## Use -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_guppi.py -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_guppi_reader.py -coverage run --source=bifrost.ring,bifrost,bifrost.pipeline test_fdmt.py ./testdata/pulsars/blc0_guppi_57407_61054_PSR_J1840%2B5640_0004.fil diff --git a/testbench/test_fdmt.py b/testbench/test_fdmt.py index c5d88b976..3050a042b 100755 --- a/testbench/test_fdmt.py +++ b/testbench/test_fdmt.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,9 +33,6 @@ Measure Transform (FDMT), writing the output to a PGM file. """ -# Python2 compatibility -from __future__ import print_function - import bifrost.pipeline as bfp from bifrost.blocks import read_sigproc, copy, transpose, fdmt, scrunch from bifrost import blocks diff --git a/testbench/test_fft.py b/testbench/test_fft.py index 596dbee25..d49fb2348 100755 --- a/testbench/test_fft.py +++ b/testbench/test_fft.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,9 +33,6 @@ takes the FFT of the data (on the GPU no less), and then writes it to a new file. """ -# Python2 compatibility -from __future__ import print_function - import os import glob import numpy as np diff --git a/testbench/test_fft_detect.py b/testbench/test_fft_detect.py index 3ca79852c..889d82b4c 100755 --- a/testbench/test_fft_detect.py +++ b/testbench/test_fft_detect.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,9 +33,6 @@ takes the FFT of the data (on the GPU no less), and then writes it to a new file. """ -# Python2 compatibility -from __future__ import print_function - import os import glob import numpy as np diff --git a/testbench/test_file_read_write.py b/testbench/test_file_read_write.py index 0161ab5bb..a60e302f3 100755 --- a/testbench/test_file_read_write.py +++ b/testbench/test_file_read_write.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,9 +33,6 @@ and then writes the data to an output file. """ -# Python2 compatibility -from __future__ import print_function - import os import numpy as np import bifrost.pipeline as bfp diff --git a/testbench/test_guppi.py b/testbench/test_guppi.py index b467d7894..9be6d9f3f 100755 --- a/testbench/test_guppi.py +++ b/testbench/test_guppi.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -32,9 +32,6 @@ This testbench tests a guppi gpuspec reader """ -# Python2 compatibility -from __future__ import print_function - import os import glob import numpy as np diff --git a/testbench/test_guppi_reader.py b/testbench/test_guppi_reader.py index 4ad90a48d..11712f522 100755 --- a/testbench/test_guppi_reader.py +++ b/testbench/test_guppi_reader.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -32,9 +32,6 @@ This testbench tests a guppi gpuspec reader """ -# Python2 compatibility -from __future__ import print_function - import os import glob import numpy as np diff --git a/testbench/your_first_block.py b/testbench/your_first_block.py index ce359d958..d722dfd64 100755 --- a/testbench/your_first_block.py +++ b/testbench/your_first_block.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2020, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,9 +33,6 @@ and then writes the data to an output file. """ -# Python2 compatibility -from __future__ import print_function - import os import numpy as np import bifrost.pipeline as bfp diff --git a/tools/bifrost_telemetry.py b/tools/bifrost_telemetry.py deleted file mode 100755 index 5e883108f..000000000 --- a/tools/bifrost_telemetry.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2021, The University of New Mexico. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Bifrost Authors nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Python2 compatibility -from __future__ import print_function, division, absolute_import - -import os -import sys -import argparse - -from bifrost import telemetry -telemetry.track_script() - - -def main(args): - # Toggle - if args.enable: - telemetry.enable() - elif args.disable: - telemetry.disable() - - # Report - ## Status - print("Bifrost Telemetry is %s" % ('active' if telemetry.is_active() else 'in-active')) - - ## Key - if args.key: - print(" Identification key: %s" % telemetry._INSTALL_KEY) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description='update the Bifrost telemetry setting', - formatter_class=argparse.ArgumentDefaultsHelpFormatter - ) - tgroup = parser.add_mutually_exclusive_group(required=False) - tgroup.add_argument('-e', '--enable', action='store_true', - help='enable telemetry for Bifrost') - tgroup.add_argument('-d', '--disable', action='store_true', - help='disable telemetry for Bifrost') - parser.add_argument('-k', '--key', action='store_true', - help='show install identification key') - args = parser.parse_args() - main(args) diff --git a/tools/getirq.py b/tools/getirq.py index 35d8178b4..fac1ff8b9 100755 --- a/tools/getirq.py +++ b/tools/getirq.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,9 +26,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import argparse from bifrost import telemetry @@ -36,9 +33,8 @@ def main(args): - fh = open('/proc/interrupts', 'r') - lines = fh.read() - fh.close() + with open('/proc/interrupts', 'r') as fh: + lines = fh.read() irqs = {} for line in lines.split('\n'): @@ -54,7 +50,7 @@ def main(args): irqs[irq] = {'cpu':mi, 'type':type, 'name':name, 'count':mv} total = sum([irqs[irq]['count'] for irq in irqs]) - print("Interface: %s" % args.interface) + print(f"Interface: {args.interface}") print("%4s %16s %16s %4s %6s" % ('IRQ', 'Name', 'Type', 'CPU', 'Usage')) for irq in sorted(irqs.keys()): print("%4i %16s %16s %4i %5.1f%%" % (irq, irqs[irq]['name'], irqs[irq]['type'], irqs[irq]['cpu'], 100.0*irqs[irq]['count']/total)) @@ -69,4 +65,3 @@ def main(args): help='interface to query') args = parser.parse_args() main(args) - diff --git a/tools/getsiblings.py b/tools/getsiblings.py index f2e559efc..ee17c56b3 100755 --- a/tools/getsiblings.py +++ b/tools/getsiblings.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,9 +27,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import glob import argparse @@ -79,4 +76,3 @@ def main(args): help='core to query') args = parser.parse_args() main(args) - diff --git a/tools/github_stats.py b/tools/github_stats.py new file mode 100644 index 000000000..2d2f4138f --- /dev/null +++ b/tools/github_stats.py @@ -0,0 +1,77 @@ +# github_stats.py – Grab a snapshot of github stats +# usage: [-h] --token-file PATH [--repo OWNER/REPO] [--output PATH] + +# Reads github user token from token-file path and appends one line of JSON to +# output path. Default repo is ledatelescope/bifrost. Default output is +# stdout. Accumulated log file is JSON-lines format +# and can be queried using `jq`. Meant to be run daily. + +# Prerequisites: python3, PyGithub + +from datetime import datetime, timezone +import argparse +import github +import json +import sys + + +class CustomEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, datetime): + return obj.isoformat() + elif isinstance(obj, (github.View.View, github.Clones.Clones)): + return obj.raw_data + else: + return super().default(obj) + + +def main(token_file, repo, output): + token = token_file.read().rstrip() + g = github.Github(token) + r = g.get_repo(repo) + snapshot = { + "timestamp": datetime.now(timezone.utc), + "repo": r.full_name, + "stars": r.stargazers_count, + "watchers": r.watchers_count, + "forks": r.forks_count, + "network": r.network_count, + "open_issues": r.open_issues_count, + "subscribers": r.subscribers_count, + "views": r.get_views_traffic(), + "clones": r.get_clones_traffic(), + } + json.dump(snapshot, output, cls=CustomEncoder) + output.write("\n") + + +parser = argparse.ArgumentParser(description="Grab snapshot of github stats.") + +parser.add_argument( + "--token-file", + "-t", + metavar="PATH", + required=True, + type=argparse.FileType("r"), + help="Read github access token from this file", +) + +parser.add_argument( + "--repo", + "-r", + metavar="OWNER/REPO", + default="ledatelescope/bifrost", + help="Grab statistics from this repo [ledatelescope/bifrost]", +) + +parser.add_argument( + "--output", + "-o", + metavar="PATH", + default=sys.stdout, + type=argparse.FileType("a"), + help="Append data to this file", +) + +if __name__ == "__main__": + main(**vars(parser.parse_args())) diff --git a/tools/like_bmon.py b/tools/like_bmon.py index 240491b5b..63406f9e6 100755 --- a/tools/like_bmon.py +++ b/tools/like_bmon.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,9 +27,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import os import sys import glob @@ -39,19 +36,16 @@ import argparse import traceback from datetime import datetime -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO +from io import StringIO os.environ['VMA_TRACELEVEL'] = '0' -from bifrost.proclog import load_by_pid +from bifrost.proclog import PROCLOG_DIR, load_by_pid from bifrost import telemetry telemetry.track_script() -BIFROST_STATS_BASE_DIR = '/dev/shm/bifrost/' +BIFROST_STATS_BASE_DIR = PROCLOG_DIR def get_transmit_receive(): @@ -85,11 +79,11 @@ def get_transmit_receive(): except KeyError: good, missing, invalid, late, nvalid = 0, 0, 0, 0, 0 - blockList['%i-%s' % (pid, block)] = {'pid': pid, 'name':block, - 'time':t, - 'good': good, 'missing': missing, - 'invalid': invalid, 'late': late, - 'nvalid': nvalid} + blockList[f"{pid}-{block}"] = {'pid': pid, 'name':block, + 'time':t, + 'good': good, 'missing': missing, + 'invalid': invalid, 'late': late, + 'nvalid': nvalid} return blockList @@ -103,10 +97,9 @@ def get_command_line(pid): cmd = '' try: - with open('/proc/%i/cmdline' % pid, 'r') as fh: + with open(f"/proc/{pid}/cmdline", 'r') as fh: cmd = fh.read() cmd = cmd.replace('\0', ' ') - fh.close() except IOError: pass return cmd @@ -121,7 +114,9 @@ def get_statistics(blockList, prevList): # Loop over the blocks to find udp_capture and udp_transmit blocks output = {'updated': datetime.now()} for block in blockList: - if block.find('udp_capture') != -1: + if block.find('udp_capture') != -1 \ + or block.find('udp_sniffer') != -1 \ + or block.find('udp_verbs_capture') != -1: ## udp_capture is RX good = True type = 'rx' @@ -248,6 +243,7 @@ def main(args): try: sel = 0 + off = 0 while True: t = time.time() @@ -261,6 +257,10 @@ def main(args): sel -= 1 elif c == curses.KEY_DOWN: sel += 1 + elif c == curses.KEY_LEFT: + off -= 8 + elif c == curses.KEY_RIGHT: + off += 8 ## Find the current selected process and see if it has changed newSel = min([nPID-1, max([0, sel])]) @@ -317,7 +317,7 @@ def main(args): k = _add_line(scr, k, 0, output, std) ### General - header k = _add_line(scr, k, 0, ' ', std) - output = '%6s %9s %6s %9s %6s' % ('PID', 'RX Rate', 'RX #/s', 'TX Rate', 'TX #/s') + output = '%7s %9s %6s %9s %6s' % ('PID', 'RX Rate', 'RX #/s', 'TX Rate', 'TX #/s') output += ' '*(size[1]-len(output)) output += '\n' k = _add_line(scr, k, 0, output, rev) @@ -337,7 +337,7 @@ def main(args): drateT, drateuT = _set_units(drateT) - output = '%6i %7.2f%2s %6i %7.2f%2s %6i\n' % (o, drateR, drateuR, prateR, drateT, drateuT, prateT) + output = '%7i %7.2f%2s %6i %7.2f%2s %6i\n' % (o, drateR, drateuR, prateR, drateT, drateuT, prateT) try: if o == order[sel]: sty = std|curses.A_BOLD @@ -359,6 +359,8 @@ def main(args): output += '\n' k = _add_line(scr, k, 0, output, rev) if act is not None: + off = min([max([0, len(act['cmd'])-size[1]+23]), max([0, off])]) + output = 'Good: %18iB %18iB\n' % (act['rx']['good' ], act['tx']['good' ]) k = _add_line(scr, k, 0, output, std) output = 'Missing: %18iB %18iB\n' % (act['rx']['missing'], act['tx']['missing']) @@ -371,7 +373,7 @@ def main(args): k = _add_line(scr, k, 0, output, std) output = 'Current Missing: %18.2f%% %18.2f%%\n' % (act['rx']['closs' ], act['tx']['closs' ]) k = _add_line(scr, k, 0, output, std) - output = 'Command: %s' % act['cmd'] + output = 'Command: %s' % act['cmd'][off:] k = _add_line(scr, k, 0, output[:size[1]], std) ### Clear to the bottom @@ -412,4 +414,3 @@ def main(args): ) args = parser.parse_args() main(args) - diff --git a/tools/like_pmap.py b/tools/like_pmap.py index 4dd825eb6..31b6a18f6 100755 --- a/tools/like_pmap.py +++ b/tools/like_pmap.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2024, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2024, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,9 +27,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import os import re import argparse @@ -89,14 +86,13 @@ def main(args): # Load in the NUMA map page for this process try: - fh = open('/proc/%i/numa_maps' % args.pid, 'r') - numaInfo = fh.read() - fh.close() + with open(f"/proc/{pid}/numa_maps", 'r') as fh: + numaInfo = fh.read() except IOError: raise RuntimeError("Cannot find NUMA memory info for PID: %i" % args.pid) # Parse out the anonymous entries in this file - _numaRE = re.compile('(?P[0-9a-f]+).*[(anon)|(mapped)]=(?P\d+).*(swapcache=(?P\d+))?.*N(?P\d+)=(?P\d+)') + _numaRE = re.compile('(?P[0-9a-f]+).*[(anon)|(mapped)]=(?P[0-9]+).*(swapcache=(?P[0-9]+))?.*N(?P[0-9]+)=(?P[0-9]+)') areas = {} files = {} for line in numaInfo.split('\n'): @@ -266,4 +262,3 @@ def main(args): help='process ID') args = parser.parse_args() main(args) - diff --git a/tools/like_ps.py b/tools/like_ps.py index 36aa09b3d..21440e068 100755 --- a/tools/like_ps.py +++ b/tools/like_ps.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,22 +27,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import os import glob import argparse import subprocess os.environ['VMA_TRACELEVEL'] = '0' -from bifrost.proclog import load_by_pid +from bifrost.proclog import PROCLOG_DIR, load_by_pid from bifrost import telemetry telemetry.track_script() -BIFROST_STATS_BASE_DIR = '/dev/shm/bifrost/' +BIFROST_STATS_BASE_DIR = PROCLOG_DIR def get_process_details(pid): @@ -65,12 +62,8 @@ def get_process_details(pid): data = {'user':'', 'cpu':0.0, 'mem':0.0, 'etime':'00:00', 'threads':0} try: - output = subprocess.check_output('ps o user,pcpu,pmem,etime,nlwp %i' % pid, shell=True) - try: - output = output.decode() - except AttributeError: - # Python2 catch - pass + output = subprocess.check_output(['ps', 'o', 'user,pcpu,pmem,etime,nlwp', str(pid)]) + output = output.decode() output = output.split('\n')[1] fields = output.split(None, 4) data['user'] = fields[0] @@ -93,10 +86,9 @@ def get_command_line(pid): cmd = '' try: - with open('/proc/%i/cmdline' % pid, 'r') as fh: + with open(f"/proc/{pid}/cmdline", 'r') as fh: cmd = fh.read() cmd = cmd.replace('\0', ' ') - fh.close() except IOError: pass return cmd @@ -206,4 +198,3 @@ def main(args): ) args = parser.parse_args() main(args) - diff --git a/tools/like_top.py b/tools/like_top.py index 64f8b69cf..e3e612e8f 100755 --- a/tools/like_top.py +++ b/tools/like_top.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,14 +26,9 @@ # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Python2 compatibility -from __future__ import print_function -import sys -if sys.version_info < (3,): - range = xrange import os +import sys import glob import time import curses @@ -42,19 +37,16 @@ import traceback import subprocess -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO +from io import StringIO os.environ['VMA_TRACELEVEL'] = '0' -from bifrost.proclog import load_by_pid +from bifrost.proclog import PROCLOG_DIR, load_by_pid from bifrost import telemetry telemetry.track_script() -BIFROST_STATS_BASE_DIR = '/dev/shm/bifrost/' +BIFROST_STATS_BASE_DIR = PROCLOG_DIR def get_load_average(): @@ -81,7 +73,6 @@ def get_load_average(): data['lastPID'] = fields[4] return data -_CPU_STATE _CPU_STATE = {} def get_processor_usage(): """ @@ -102,8 +93,7 @@ def get_processor_usage(): with open('/proc/stat', 'r') as fh: lines = fh.read() - fh.close() - + for line in lines.split('\n'): if line[:3] == 'cpu': fields = line.split(None, 10) @@ -156,8 +146,7 @@ def get_memory_swap_usage(): with open('/proc/meminfo', 'r') as fh: lines = fh.read() - fh.close() - + for line in lines.split('\n'): fields = line.split(None, 2) if fields[0] == 'MemTotal:': @@ -227,10 +216,9 @@ def get_command_line(pid): cmd = '' try: - with open('/proc/%i/cmdline' % pid, 'r') as fh: + with open(f"/proc/{pid}/cmdline", 'r') as fh: cmd = fh.read() cmd = cmd.replace('\0', ' ') - fh.close() except IOError: pass return cmd @@ -344,7 +332,7 @@ def main(args): except KeyError: ac, pr, re = 0.0, 0.0, 0.0 - blockList['%i-%s' % (pid, block)] = {'pid': pid, 'name':block, 'cmd': cmd, 'core': cr, 'acquire': ac, 'process': pr, 'reserve': re, 'total':ac+pr+re} + blockList[f"{pid}-{block}"] = {'pid': pid, 'name':block, 'cmd': cmd, 'core': cr, 'acquire': ac, 'process': pr, 'reserve': re, 'total':ac+pr+re} ## Sort order = sorted(blockList, key=lambda x: blockList[x][sort_key], reverse=sort_rev) @@ -384,6 +372,8 @@ def main(args): k = _add_line(scr, k, 0, ' ', std) output = '%6s %15s %4s %5s %7s %7s %7s %7s Cmd' % ('PID', 'Block', 'Core', '%CPU', 'Total', 'Acquire', 'Process', 'Reserve') csize = size[1]-len(output) + if csize < 0: + csize = 0 output += ' '*csize output += '\n' k = _add_line(scr, k, 0, output, rev) @@ -450,4 +440,3 @@ def main(args): ) args = parser.parse_args() main(args) - diff --git a/tools/pipeline2dot.py b/tools/pipeline2dot.py index 9c88e3773..b9652796a 100755 --- a/tools/pipeline2dot.py +++ b/tools/pipeline2dot.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. -# Copyright (c) 2017-2021, The University of New Mexico. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The University of New Mexico. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,22 +27,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import os import sys import glob import argparse import subprocess -from bifrost.proclog import load_by_pid +from bifrost.proclog import PROCLOG_DIR, load_by_pid from bifrost import telemetry telemetry.track_script() -BIFROST_STATS_BASE_DIR = '/dev/shm/bifrost/' +BIFROST_STATS_BASE_DIR = PROCLOG_DIR def get_process_details(pid): @@ -65,10 +62,8 @@ def get_process_details(pid): data = {'user':'', 'cpu':0.0, 'mem':0.0, 'etime':'00:00', 'threads':0} try: - output = subprocess.check_output('ps o user,pcpu,pmem,etime,nlwp %i' % pid, shell=True) - if sys.version_info.major > 2 and isinstance(output, bytes): - # decode the output to utf-8 in python 3 - output = output.decode("utf-8") + output = subprocess.check_output(['ps', 'o', 'user,pcpu,pmem,etime,nlwp', str(pid)]) + output = output.decode() output = output.split('\n')[1] fields = output.split(None, 4) data['user'] = fields[0] @@ -91,10 +86,9 @@ def get_command_line(pid): cmd = '' try: - with open('/proc/%i/cmdline' % pid, 'r') as fh: + with open(f"/proc/{pid}/cmdline", 'r') as fh: cmd = fh.read() cmd = cmd.replace('\0', ' ') - fh.close() except IOError: pass return cmd @@ -170,7 +164,7 @@ def get_data_flows(blocks): if blocks[other_block][log]['complex']: bits *= 2 name = 'cplx' if blocks[other_block][log]['complex'] else 'real' - dtype = '%s%i' % (name, bits) + dtype = f"{name}{bits}" except KeyError: pass elif log not in ('in', 'out'): @@ -198,7 +192,7 @@ def get_data_flows(blocks): refCores = [] for i in range(32): try: - refCores.append( blocks[block]['bind']['core%i' % i] ) + refCores.append( blocks[block]['bind'][f"core{i}"] ) except KeyError: break @@ -212,7 +206,7 @@ def get_data_flows(blocks): other_cores = [] for i in range(32): try: - other_cores.append( blocks[other_block]['bind']['core%i' % i] ) + other_cores.append( blocks[other_block]['bind'][f"core{i}"] ) except KeyError: break @@ -353,4 +347,3 @@ def main(args): help='exclude associated blocks') args = parser.parse_args() main(args) - diff --git a/tools/setirq.py b/tools/setirq.py index 116b7c245..254f322e6 100755 --- a/tools/setirq.py +++ b/tools/setirq.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2021, The Bifrost Authors. All rights reserved. +# Copyright (c) 2017-2023, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -26,9 +26,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Python2 compatibility -from __future__ import print_function - import argparse from bifrost import telemetry @@ -57,9 +54,8 @@ def write_irq_smp_affinity(irq, mask): def main(args): - fh = open('/proc/interrupts', 'r') - lines = fh.read() - fh.close() + with open('/proc/interrupts', 'r') as fh: + lines = fh.read() irqs = {} for line in lines.split('\n'): @@ -74,7 +70,7 @@ def main(args): mi = procs.index(mv) irqs[irq] = {'cpu':mi, 'type':type, 'name':name, 'count':mv} - print("Interface: %s" % args.interface) + print(f"Interface: {args.interface}") print("%4s %16s %16s %7s %7s" % ('IRQ', 'Name', 'Type', 'Old CPU', 'New CPU') ) for i,irq in enumerate(sorted(irqs.keys())): oCPU = irqs[irq]['cpu'] @@ -97,4 +93,3 @@ def main(args): help='CPU to bind to') args = parser.parse_args() main(args) - diff --git a/tutorial/.github/workflows/main.yml b/tutorial/.github/workflows/main.yml new file mode 100644 index 000000000..b9ae1a808 --- /dev/null +++ b/tutorial/.github/workflows/main.yml @@ -0,0 +1,62 @@ +name: Test +on: + push: + pull_request: + schedule: + - cron: '30 5 4 * *' + +jobs: + build: + runs-on: self-hosted + strategy: + matrix: + python-version: ['3.6', '3.8'] + fail-fast: false + steps: + - name: "Software Install - Ubuntu" + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + ca-certificates \ + curl \ + exuberant-ctags \ + gfortran \ + git \ + libopenblas-dev \ + pkg-config \ + software-properties-common + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v2 + - name: "Software Install - Python" + run: python -m pip install \ + setuptools \ + numpy \ + matplotlib \ + contextlib2 \ + simplejson \ + pint \ + graphviz \ + ctypesgen==1.0.2 \ + numba \ + jupyterlab \ + jupyter_client \ + nbformat \ + nbconvert + - name: "Software Install - Bifrost" + run: | + git clone https://github.com/ledatelescope/bifrost + cd bifrost + ./configure + make -j all + sudo make install + cd .. + - name: Test + env: + LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }} + run: | + python -m pip install scipy + cd test + python -m unittest discover diff --git a/tutorial/.gitignore b/tutorial/.gitignore new file mode 100644 index 000000000..b6e47617d --- /dev/null +++ b/tutorial/.gitignore @@ -0,0 +1,129 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/tutorial/00_getting_started.ipynb b/tutorial/00_getting_started.ipynb new file mode 100644 index 000000000..32f0e7cab --- /dev/null +++ b/tutorial/00_getting_started.ipynb @@ -0,0 +1,556 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1dfd7ec3", + "metadata": { + "id": "1dfd7ec3" + }, + "source": [ + "# Getting started with Bifrost\n", + "\n", + "These tutorials require an installation of Bifrost and a machine with a GPU. The simplest way to start is using Google Colab. There are tips for other ways to run them in [the README](https://github.com/ledatelescope/bifrost/blob/master/tutorial/README.md).\n", + "\n", + "\"Open\n", + "\n", + "Once Bifrost is installed you can load the Python API with\n", + "```python\n", + "import bifrost\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "proud-container", + "metadata": { + "id": "proud-container" + }, + "outputs": [], + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError:\n", + " try:\n", + " import google.colab\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy ctypesgen==1.0.2\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure && make -j all && sudo make install)\n", + " import bifrost\n", + " except ModuleNotFoundError:\n", + " print(\"Sorry, could not import bifrost and we're not on colab.\")" + ] + }, + { + "cell_type": "markdown", + "id": "rental-equipment", + "metadata": { + "id": "rental-equipment" + }, + "source": [ + "This loads the core parts of Bifrost and several useful functions. The main way of interacting with Bifrost is through the `bifrost.ndarray`, a sub-class of `numpy.ndarray`. You can create an empty array with:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "subject-quebec", + "metadata": { + "id": "subject-quebec", + "outputId": "35f71b57-fd1b-4113-ad3d-5e7430ad603e", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " float32 (2, 4096) system\n", + "[[ 2.2875120e-35 0.0000000e+00 1.5581004e-38 ... 1.3563156e-19\n", + " 2.8297670e+20 2.6373977e+23]\n", + " [ 2.0704474e-19 7.1220526e+28 1.4251251e-13 ... 2.7550649e-40\n", + " 6.1529782e-39 -5.7935773e-05]]\n" + ] + } + ], + "source": [ + "data = bifrost.ndarray(shape=(2,4096), dtype='f32', space='system')\n", + "print(type(data), data.dtype, data.shape, data.bf.space)\n", + "print(data)" + ] + }, + { + "cell_type": "markdown", + "id": "eleven-omaha", + "metadata": { + "id": "eleven-omaha" + }, + "source": [ + "Note that bifrost defines datatypes differently to numpy:\n", + "```\n", + "f32: 32-bit float (equivalent to numpy float32)\n", + "cf32: complex 32-bit data (equivalent to numpy complex64)\n", + "i[8,16,32]: signed integer datatypes of 8, 16 and 32-bit width\n", + "u[8,16,32]: unsigned integer datatypes of 8, 16 and 32-bit width\n", + "ci[4,8,16,32]: complex 4-bit per sample, 8-bit, 16-bit and 32-bit datatypes\n", + "```\n", + "\n", + "The `ci4`, `ci8` and `ci16` datatypes do not have an equivalent numpy type, but are commonly encountered in radio astronomy.\n", + "\n", + "You can also use the `bifrost.ndarray` to wrap existing numpy arrays:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "lightweight-madrid", + "metadata": { + "id": "lightweight-madrid", + "outputId": "e0b40abb-6d54-4fa8-d552-36d73feea486", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " float64 (2, 4096) system\n", + "r: [[-0.3415904 0.07395837 1.1215293 ... 0.52340138 -0.43369748\n", + " 0.99678685]\n", + " [-0.74268647 1.9056947 -0.23712155 ... 0.65987519 1.13804761\n", + " 0.36587976]]\n", + "data: [[-0.3415904 0.07395837 1.1215293 ... 0.52340138 -0.43369748\n", + " 0.99678685]\n", + " [-0.74268647 1.9056947 -0.23712155 ... 0.65987519 1.13804761\n", + " 0.36587976]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "r = numpy.random.randn(2, 4096)\n", + "data = bifrost.ndarray(r)\n", + "print(type(data), data.dtype, data.shape, data.bf.space)\n", + "print('r:', r)\n", + "print('data:', data)" + ] + }, + { + "cell_type": "markdown", + "id": "earlier-latino", + "metadata": { + "id": "earlier-latino" + }, + "source": [ + "Since `bifrost.ndarray`s are derived from numpy arrays they can do many (but not all) of the same things:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "regional-darkness", + "metadata": { + "id": "regional-darkness", + "outputId": "90fef638-53cf-4c47-9c85-da83fc6dbaf1", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "data += 2.0: [[1.6584096 2.07395837 3.1215293 ... 2.52340138 1.56630252 2.99678685]\n", + " [1.25731353 3.9056947 1.76287845 ... 2.65987519 3.13804761 2.36587976]]\n", + "data[0,:] = 55: [[55. 55. 55. ... 55. 55.\n", + " 55. ]\n", + " [ 1.25731353 3.9056947 1.76287845 ... 2.65987519 3.13804761\n", + " 2.36587976]]\n" + ] + } + ], + "source": [ + "data += 2.0\n", + "print('data += 2.0:', data)\n", + "data[0,:] = 55\n", + "print('data[0,:] = 55:', data)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "artificial-spider", + "metadata": { + "id": "artificial-spider", + "outputId": "a27f7776-1f3c-45e1-8320-43d3ed6a2d5a", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "data[:,[1,3,5,7]] = 10: [[55. 55. 55. ... 55. 55.\n", + " 55. ]\n", + " [ 1.25731353 3.9056947 1.76287845 ... 2.65987519 3.13804761\n", + " 2.36587976]]\n" + ] + } + ], + "source": [ + "data[:,[1,3,5,7]] = 10\n", + "print('data[:,[1,3,5,7]] = 10:', data)" + ] + }, + { + "cell_type": "markdown", + "id": "thirty-stretch", + "metadata": { + "id": "thirty-stretch" + }, + "source": [ + "You can also use `bifrost.ndarray`s with [numba](https://numba.pydata.org/):" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "smaller-organizer", + "metadata": { + "id": "smaller-organizer", + "outputId": "6bfd54c2-16e7-4fdb-b5ce-3155ae447ce9", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " [[65. 65. 65. ... 65. 65.\n", + " 65. ]\n", + " [11.25731353 13.9056947 11.76287845 ... 12.65987519 13.13804761\n", + " 12.36587976]]\n" + ] + } + ], + "source": [ + "from numba import jit\n", + "\n", + "@jit(nopython=True)\n", + "def compute(x):\n", + " for i in range(len(x)):\n", + " x[i] = x[i] + 10\n", + "\n", + "compute(data)\n", + "print(type(data), data)" + ] + }, + { + "cell_type": "markdown", + "id": "informative-brush", + "metadata": { + "id": "informative-brush" + }, + "source": [ + "### Arrays on the CPU and GPU" + ] + }, + { + "cell_type": "markdown", + "id": "acute-efficiency", + "metadata": { + "id": "acute-efficiency" + }, + "source": [ + "Unlike numpy arrays `bifrost.ndarray` are \"space aware\", meaning that they can exist in different memory spaces. What we have created so far is in system memory. `bifrost.ndarray`s can also exist in \"cuda_host\" (pinned) memory and \"cuda\" (GPU) memory:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "changing-enhancement", + "metadata": { + "id": "changing-enhancement", + "outputId": "8def579b-b38e-44dc-efbc-2b59655a8185", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " float32 (2, 4096) cuda_host\n", + " float32 (2, 4096) cuda\n" + ] + } + ], + "source": [ + "data2 = bifrost.ndarray(shape=(2,4096), dtype='f32', space='cuda_host')\n", + "data3 = bifrost.ndarray(shape=(2,4096), dtype='f32', space='cuda')\n", + "print(type(data2), data2.dtype, data2.shape, data2.bf.space)\n", + "print(type(data3), data3.dtype, data3.shape, data3.bf.space)" + ] + }, + { + "cell_type": "markdown", + "id": "million-guess", + "metadata": { + "id": "million-guess" + }, + "source": [ + "To move between the different spaces the `bifrost.ndarray` class provides a `copy` method:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "talented-lending", + "metadata": { + "id": "talented-lending", + "outputId": "575c6d4e-009f-45cc-de40-5b19aa96b27e", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " float64 (2, 4096) cuda\n" + ] + } + ], + "source": [ + "data4 = data.copy(space='cuda')\n", + "print(type(data4), data4.dtype, data4.shape, data4.bf.space)" + ] + }, + { + "cell_type": "markdown", + "id": "stable-instrumentation", + "metadata": { + "id": "stable-instrumentation" + }, + "source": [ + "Once on the GPU you can take advantage of Bifrost's GPU-based functions, like `bifrost.map`:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "prospective-financing", + "metadata": { + "id": "prospective-financing", + "outputId": "f8b315b1-1a21-4e7b-f4b4-38af5ed37c11", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "data4/data = data*10/data = 10: [[10. 10. 10. ... 10. 10. 10.]\n", + " [10. 10. 10. ... 10. 10. 10.]]\n" + ] + } + ], + "source": [ + "bifrost.map(\"a(i,j) *= 10\",\n", + " {'a': data4},\n", + " axis_names=('i', 'j'),\n", + " shape=data4.shape)\n", + "data4 = data4.copy(space='system')\n", + "print('data4/data = data*10/data = 10:', data4/data)" + ] + }, + { + "cell_type": "markdown", + "id": "amateur-bridges", + "metadata": { + "id": "amateur-bridges" + }, + "source": [ + "The `bifrost.map` call here compiles and runs a CUDA kernel that does an element-wise multiplication by ten. In order to view the results of this kernel call we need to copy the memory back to the \"system\" memory space. In the future we hope to support a \"cuda_managed\" space to make this easier." + ] + }, + { + "cell_type": "markdown", + "id": "vocational-archives", + "metadata": { + "id": "vocational-archives" + }, + "source": [ + "`bifrost.map` is an example of a function that does not require any additional setup to run. This code is converted into a CUDA kernel at runtime, using [NVRTC](https://docs.nvidia.com/cuda/nvrtc/index.html). \n", + "\n", + "For some Bifrost functions, like `bifrost.fft.Fft`, some setup is required so that the function knows how to run. To show the use of the Bifrost FFT, let us first make some example data on the GPU, using `bf.map`:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "restricted-carrier", + "metadata": { + "id": "restricted-carrier", + "outputId": "4645aa43-2fbe-47eb-c051-727cef930472", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 297 + } + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "" + ] + }, + "metadata": {}, + "execution_count": 12 + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEGCAYAAABLgMOSAAA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CiqJyNAzs4eYLll+eBGT05tiXCeooEtgN86aDPw/ITwz1kWRpcA3Zb65iXg4yKSblkhfdwKO2ew9M2PA4eVUj+ecMrU1QREJFtEFlrHScAN6Pmi14BNVrQz68lff5uAV62R3Bbgbsv6qARYDuwOTymcRyn1TaVUoVKqGN3uvKqU+iuiqZ4ibWEQCx+0tcxRtJ72W5HOTwTK/1vgJDCC1p/ej9at7gSqgVeADCuuAI9ZdXUQ2Dghnb9GT+DVAPdFulwO1NMVaPXUAWCf9bnF1NWUeloLfGjVUwXwL1b4UqthqwF+ByRa4fOs3zXW+aUT0vqWVX9VwM2RLpuDdXY1p62woqaejCsTg8FgMASFUWEZDAaDISiMADEYDAZDUBgBYjAYDIagMALEYDAYDEFhBIjBYDAYgsIIEIPBAUQkU0T2WR+PiDRZx14R+X+Rzp/BYAfGjNdgcBgR+Q7gVUr9MNJ5MRjsxIxADIYwIiJXT9jX4Tsi8qSIvCUidSLySRH5gYgcFJHtllsURGSDiLwhIu+LyEt+tygGQ6QxAsRgiCznoX0c3Q78BnhNKbUGGAButYTI/wU2KaU2AL8EvhepzBoME4k/exSDweAg25RSIyJyEL152XYr/CBQDJQBq4Ed2tUWcWi3MgZDxDECxGCILEMASimfiIyo05OSPvT7KUClUurSSGXQYJgJo8IyGKKbKiBbRC4F7S5eRFZFOE8GA2AEiMEQ1Si9jfIm4GER2Y/28HtZZHNlMGiMGa/BYDAYgsKMQAwGg8EQFEaAGAwGgyEojAAxGAwGQ1AYAWIwGAyGoDACxGAwGAxBYQSIwWAwGILCCBCDwWAwBMX/B/uTiBNF4AvkAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "data = bifrost.ndarray(shape=(16, 4096), dtype='cf32', space='cuda')\n", + "bifrost.map(\"a(i,j) = exp(Complex(0.0, 2*3.14*i*j/4096))\",\n", + " {'a': data},\n", + " axis_names=('i', 'j'),\n", + " shape=data.shape)\n", + "data2 = data.copy(space='system')\n", + "\n", + "import pylab\n", + "pylab.plot(data2[0,:].real, label='Re0')\n", + "#pylab.plot(data2[0,:].imag, label='Im0')\n", + "pylab.plot(data2[2,:].real, label='Re2')\n", + "#pylab.plot(data2[2,:].imag, label='Im2')\n", + "pylab.plot(data2[5,:].real, label='Re5')\n", + "#pylab.plot(data2[5,:].imag, label='Im5')\n", + "pylab.xlabel('Time')\n", + "pylab.ylabel('Value')\n", + "pylab.legend(loc=0)" + ] + }, + { + "cell_type": "markdown", + "id": "soviet-conference", + "metadata": { + "id": "soviet-conference" + }, + "source": [ + "Now run the FFT and plot the results. The FFT is initialised using its `.init` method, and then executed using its `.execute` method. An output data array also needs to be pre-allocated :" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "moral-worship", + "metadata": { + "id": "moral-worship", + "outputId": "df15893d-a150-41dc-bd17-d76a73f04deb", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 297 + } + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "" + ] + }, + "metadata": {}, + "execution_count": 13 + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEGCAYAAACkQqisAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3de3zcdZ3v8dcn9/v90jZpm5TeMikIbbkpIijQoig3zwq4wlk41gu6y7KehV3WXS+7BzyyiizIOaiI+tgF9YiKbmmriFYE7AVhodOmTduUJrRJm3vS3PM5f/xmcmvSJJOZ329m8nk+HvPIzK8zv/kmnZn3fL+f3/f7E1XFGGOMCUWC1w0wxhgTuyxEjDHGhMxCxBhjTMgsRIwxxoTMQsQYY0zIkrxuQCQUFRVpRUWF180wxpiYsnv37pOqWjybx8RliFRUVLBr1y6vm2GM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DDwE5VbZ3Tb2jMLFlPxJgZUtVtIlIFvByodXcBf66qr4rID4HXcc6/sHPMwx7EWRV1E/CfY7Z/G2eY6tVA4fwEZzgVqar2i8hHgH8TkXScesgVQJeq7haRDuC7YfpVjZkxO8TXmDATkS/gfLg/6NLzLQJ+C6y2Q5CN22w4y5gYJiK34pwn/T4LEOMF64kYY4wJmfVEjDHGhMxCxBhjTMgsRIwxxoTMQsQYY0zILESMMcaE7P8DkKEiQiN+KUYAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "fdata = bifrost.ndarray(shape=data.shape, dtype='cf32', space='cuda')\n", + "f = bifrost.fft.Fft()\n", + "f.init(data, fdata, axes=1, apply_fftshift=True)\n", + "f.execute(data, fdata)\n", + "fdata2 = fdata.copy(space='system')\n", + "ffreqs = numpy.fft.fftfreq(fdata2.shape[1], d=1/4096.)\n", + "ffreqs = numpy.fft.fftshift(ffreqs)\n", + "\n", + "pylab.semilogy(ffreqs, numpy.abs(fdata2[0,:])**2, label='0')\n", + "pylab.semilogy(ffreqs, numpy.abs(fdata2[2,:])**2, label='2')\n", + "pylab.semilogy(ffreqs, numpy.abs(fdata2[5,:])**2, label='5')\n", + "pylab.xlabel('Frequency')\n", + "pylab.ylabel('Power')\n", + "pylab.xlim(-10, 10)\n", + "pylab.xticks([-10,-5,0,2,5,10])\n", + "pylab.legend(loc=0)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.6" + }, + "colab": { + "name": "00_getting_started.ipynb", + "provenance": [] + }, + "accelerator": "GPU", + "gpuClass": "standard" + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tutorial/01_useful_functions.ipynb b/tutorial/01_useful_functions.ipynb new file mode 100644 index 000000000..bb17f7573 --- /dev/null +++ b/tutorial/01_useful_functions.ipynb @@ -0,0 +1,529 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "5ecd430b", + "metadata": { + "id": "5ecd430b" + }, + "source": [ + "# Useful Functions in Bifrost\n", + "\n", + "\"Open\n", + "\n", + "With the basics of how to get data onto and off of the GPU, we can now start to look at useful functions in Bifrost. Bifrost provides many functions that run on GPUs and interact via `bifrost.ndarray`s:\n", + "\n", + " * `bifrost.fdmt` — the fast dispersion measure transform\n", + " * `bifrost.fft` — multi-dimensional Fourier transforms\n", + " * `bifrost.fir` — finite impulse response (FIR) filters\n", + " * `bifrost.linalg` — linear algebra module for matrix-matrix operations\n", + " * `bifrost.map` — JIT functions for element-wise operations\n", + " * `bifrost.quantize` — quantizers for moving between floating and integer types\n", + " * `bifrost.reduce` — reduction (sum, min, max, etc.) array operations\n", + " * `bifrost.romein` — data gridder\n", + " * `bifrost.transpose` — data transpositions\n", + " * `bifrost.unpack` — unpackers for moving between integer and floating types\n", + "\n", + "We have already seen maps and FFTs in action so let's look at some of the other functions here." + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError:\n", + " try:\n", + " import google.colab\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure && make -j all && sudo make install)\n", + " import bifrost\n", + " except ModuleNotFoundError:\n", + " print(\"Sorry, could not import bifrost and we're not on colab.\")" + ], + "metadata": { + "id": "fM8F7RpjKayt" + }, + "id": "fM8F7RpjKayt", + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "bd3473d6", + "metadata": { + "id": "bd3473d6" + }, + "source": [ + "## bifrost.reduce\n", + "\n", + "`bifrost.reduce` is a complement to `bifrost.map` that deals with operations that reduce the size of an array, like a summation along an axis." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "ccc10558", + "metadata": { + "id": "ccc10558", + "outputId": "ee89a590-fb00-4aee-9e66-efcd9a882b28", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "numpy: [ 4.140649 18.068268 -28.093277 -3.199566 -7.7478523 32.780075\n", + " -37.850746 -24.040245 25.390383 54.569324 ]\n", + "bifrost: [ 4.140649 18.068268 -28.093285 -3.1995583 -7.7478404 32.780083\n", + " -37.850758 -24.040249 25.390385 54.56932 ]\n" + ] + } + ], + "source": [ + "import numpy\n", + "data = numpy.random.randn(10, 1000)\n", + "data = data.astype(numpy.float32)\n", + "sdata = data.sum(axis=1)\n", + "print('numpy:', sdata)\n", + "\n", + "data = bifrost.ndarray(data, space='cuda')\n", + "sdata = bifrost.ndarray(shape=(data.shape[0], 1), dtype=sdata.dtype,\n", + " space='cuda')\n", + "bifrost.reduce(data, sdata, op='sum')\n", + "sdata2 = sdata.copy(space='system')\n", + "print('bifrost:', sdata2[:,0])" + ] + }, + { + "cell_type": "markdown", + "id": "afb6b49d", + "metadata": { + "id": "afb6b49d" + }, + "source": [ + "During a reduction Bifrost uses the difference in the dimensions of the input and output arrays to determine what axis to run the reduction on. Here we have summed along the second axis by setting that dimension to one for sdata.\n", + "\n", + "In addition to sum, there are also reduction operations that work on power, i.e., magnitude squared:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "17a76f06", + "metadata": { + "id": "17a76f06", + "outputId": "55a60a6e-f08c-4b0b-bc93-dc99ed30e95f", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "numpy: [1010.9479 1074.0662 997.83887 917.8666 988.5895 993.8688\n", + " 1045.6895 993.13806 1067.0187 1014.4079 ]\n", + "bifrost: [1010.94824 1074.0671 997.8386 917.8666 988.58954 993.8687\n", + " 1045.6901 993.1382 1067.019 1014.4079 ]\n" + ] + } + ], + "source": [ + "data = numpy.random.randn(10, 1000)\n", + "data = data.astype(numpy.float32)\n", + "sdata = (data**2).sum(axis=1)\n", + "print('numpy:', sdata)\n", + "\n", + "data = bifrost.ndarray(data, space='cuda')\n", + "sdata = bifrost.ndarray(shape=(data.shape[0], 1), dtype=sdata.dtype,\n", + " space='cuda')\n", + "bifrost.reduce(data, sdata, op='pwrsum')\n", + "sdata2 = sdata.copy(space='system')\n", + "print('bifrost:', sdata2[:,0])" + ] + }, + { + "cell_type": "markdown", + "id": "df8b8726", + "metadata": { + "id": "df8b8726" + }, + "source": [ + "`bifrost.reduce` currently only supports explicit reduction along one axis at a time. However, it may be possible to run multi-dimensional reductions for reshaping the data:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "50c5887d", + "metadata": { + "id": "50c5887d", + "outputId": "6725e484-515c-44e2-9737-65c095725ad6", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "numpy: 10091.392\n", + "bifrost: 10091.382\n" + ] + } + ], + "source": [ + "data = numpy.random.randn(10, 1000)\n", + "data = data.astype(numpy.float32)\n", + "sdata = (data**2).sum()\n", + "print('numpy:', sdata)\n", + "\n", + "data = bifrost.ndarray(data, space='cuda')\n", + "data = data.reshape(data.shape[0]*data.shape[1])\n", + "sdata = bifrost.ndarray(shape=(1,), dtype=sdata.dtype, space='cuda')\n", + "bifrost.reduce(data, sdata, op='pwrsum')\n", + "sdata2 = sdata.copy(space='system')\n", + "print('bifrost:', sdata2[0])" + ] + }, + { + "cell_type": "markdown", + "id": "85537a6d", + "metadata": { + "id": "85537a6d" + }, + "source": [ + "## bifrost.transpose\n", + "\n", + "For some data processing it may be more convenient to have the axis in a different order. To transpose a GPU array in Bifrost there is the `bifrost.transpose` function:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "1c7cf1a4", + "metadata": { + "id": "1c7cf1a4", + "outputId": "f8371a1f-f594-4a08-d4a6-fba1ec6faea3", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "numpy: -0.3481426 -> -0.3481426\n", + "bifrost: -0.3481426 -> -0.3481426\n" + ] + } + ], + "source": [ + "data = numpy.random.randn(10, 1000)\n", + "data = data.astype(numpy.float32)\n", + "tdata = data.T.copy()\n", + "print('numpy:', data[0,9], '->', tdata[9,0])\n", + "\n", + "data = bifrost.ndarray(data, space='cuda')\n", + "tdata = bifrost.ndarray(shape=data.shape[::-1], dtype=data.dtype,\n", + " space='cuda')\n", + "bifrost.transpose(tdata, data, axes=(1,0))\n", + "data2 = data.copy(space='system')\n", + "tdata2 = tdata.copy(space='system')\n", + "print('bifrost:', data2[0,9], '->', tdata2[9,0])" + ] + }, + { + "cell_type": "markdown", + "id": "bf2d856f", + "metadata": { + "id": "bf2d856f" + }, + "source": [ + "Unlike `bifrost.reduce`, `bifrost.transpose` requires you to have both an output array with the correct shape and to explicitly specify the axis ordering in the call.\n", + "\n", + "This function also supports general data re-ordering operations as well:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "40228867", + "metadata": { + "id": "40228867", + "outputId": "95617589-b0e9-44ab-a16d-2f451892ed80", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "numpy: -0.78903913 -> -0.78903913\n", + "bifrost: -0.78903913 -> -0.78903913\n" + ] + } + ], + "source": [ + "data = numpy.random.randn(10, 20, 30, 40)\n", + "data = data.astype(numpy.float32)\n", + "tdata = data.transpose(1,3,2,0).copy()\n", + "print('numpy:', data[1,3,5,7], '->', tdata[3,7,5,1])\n", + "\n", + "data = bifrost.ndarray(data, space='cuda')\n", + "tdata = bifrost.ndarray(shape=[data.shape[v] for v in (1,3,2,0)],\n", + " dtype=data.dtype, space='cuda')\n", + "bifrost.transpose(tdata, data, axes=(1,3,2,0))\n", + "data2 = data.copy(space='system')\n", + "tdata2 = tdata.copy(space='system')\n", + "print('bifrost:', data2[1,3,5,7], '->', tdata2[3,7,5,1])" + ] + }, + { + "cell_type": "markdown", + "id": "6e291072", + "metadata": { + "id": "6e291072" + }, + "source": [ + "## bifrost.fdmt\n", + "\n", + "Bifrost includes a module for computing the fast dispersion measure transform of [Zackay and Ofek](https://iopscience.iop.org/article/10.3847/1538-4357/835/1/11/meta) (2017, ApJ 835 11) for incoherent dedispersion. Like the `bifrost.fft` module using the FDMT requires some setup. To get started let's make a simulation dispersed pulse at a DM of 5.5 pc/cm³:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "acb5f590", + "metadata": { + "id": "acb5f590", + "outputId": "f5d0776c-f6cb-4384-c1e9-a6efb157f21d", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 283 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZMAAAEKCAYAAADXdbjqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9W8xtWXYe9M3Luuy9/+u5VVV3OeYS2xAhWZBWREQIQpFsJ4KYJ14s4QCRxRPiiRDxBi9cXhDKA/FDpCARCUvI4irjFkoEkUCJEe0kEhFObLe7uy6n/vPf92WtNS88fGOMuU+77bZdp2yl9C+pVFXn/P/ea80157h84xvfcLVWPF1P19P1dD1dT9fnufwf9A08XU/X0/V0PV3/6F9PzuTperqerqfr6frc15Mzebqerqfr6Xq6Pvf15Eyerqfr6Xq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JC+SGi18RMRmQzRzRURsLJ4EcArJSwCtL1GrDnhMkHyjiDwoIjcB2I+ja0tERGw6xJVJRMQGQkQGJD8M4LMkt0Lfuc9AKciPhz8meS50ZXMPlLY8ImLTIoYGR0RsAsTQ4IiTHdHMFRGxOTAP4FNrJS0C+BqAV8cmVUTEOhFXJhERERERQyOuTCIiIiIihkacTCIiIiIihkacTCIiIiIihkacTCIiIiIihsb/AbqINi/rnusiAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "DM = 1.25\n", + "time = numpy.linspace(0, 2, 1000)\n", + "freq = numpy.linspace(50e6, 70e6, 200)\n", + "data = numpy.random.randn(freq.size, time.size)\n", + "data[:,100] += 10.0\n", + "data[:,101] += 8.0\n", + "data[:,102] += 4.0\n", + "data[:,103] += 1.0\n", + "for i in range(freq.size):\n", + " delay = 4.15e-3 * DM * ((freq[i]/1e9)**-2 - (freq[-1]/1e9)**-2)\n", + " delay = int(round(delay / (time[1] - time[0])))\n", + " data[i,:] = numpy.roll(data[i,:], delay)\n", + "data = data.astype(numpy.float32)\n", + "\n", + "import pylab\n", + "pylab.imshow(data, extent=(time[0], time[-1], freq[-1]/1e6, freq[0]/1e6))\n", + "pylab.axis('auto')\n", + "pylab.xlabel('Time [s]')\n", + "pylab.ylabel('Frequency [MHz]'); None" + ] + }, + { + "cell_type": "markdown", + "id": "a65b79b7", + "metadata": { + "id": "a65b79b7" + }, + "source": [ + "Now setup and run the FDMT on the data:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "7c33477b", + "metadata": { + "id": "7c33477b", + "outputId": "49870b5d-a24e-47ef-c324-8fe5290b5d90", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 283 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ8AAAEKCAYAAADNSVhkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgA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t9S37a0vVQVZ1o+heK80EV19Gfql3uAO4Zp07bts2MdXeeD4oqMfRR/uFeneV+h2HsAuAD4afryPA7MztZdndbrB26qOc7fAv8CdqbHg2n+IqAvfWH6gJU1x/l1YG+KZwtwVbbuR1M/7wc+Umec6fla4Bul9SrrT4r/ag8DJyiOi68EVgGr0nIB30+/Qx+woKa+HCnOu4AXs21zR5o/O/XjrrRNrK45zs9k2+Y2smTZbHupK87UZgXFBU/5epX1J8Wh0wB2Z5/r0k5tny6vY2ZmlRuP53zMzKzLOfmYmVnlnHzMzKxyTj5mZlY5Jx8zM6uck4+ZmVXOycesDSRdnJXE/6ekQ2n6mKQfdOD91ks6KGnVMG3elsrjNy3jb1Yn3+dj1maS1lIM0fDtDr7HeoqhAjaM0G5WandNp2IxOxfe8zHroDSY2cNpeq2kuyX9UdJfJb1P0jfTQGGPpLpaSJov6fepivGvU8n6kd7nA2kQsl2S6iriadYyJx+zal1BUfH7VuDHwJaIeCPwX+DmlIC+C9wWEfOBdcDXWnjdNcDiiLg2vbZZV/OQCmbV2hgRJyT1UYym+Uia30dRePJK4BqK0vmkNodbeN3HgPWSHgCaVSM26ypOPmbVOg4QEacknYiBk66nKL6PAvZGxMKzedGIWCXpLRRVh5+QND+yYQ7Muo0Pu5l1l37gtZIWQjG+Sjb65pAkXRER2yNiDfAcg8dWMes63vMx6yIR8Yqk24A7JU2h+I7eQVFOfzjfkjSHYs/pUYoS/GZdy5dam41BvtTaxjofdjMbm44CXx3pJlPgIeD5yqIya5H3fMzMrHLe8zEzs8o5+ZiZWeWcfMzMrHJOPmZmVrn/A07/JwMbhu4zAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "data = bifrost.ndarray(data, space='cuda')\n", + "ddata = bifrost.ndarray(shape=(time.size, time.size),\n", + " dtype=data.dtype, space='cuda')\n", + "f = bifrost.fdmt.Fdmt()\n", + "f.init(freq.size, time.size, freq[0]/1e6, (freq[1]-freq[0])/1e6)\n", + "f.execute(data, ddata)\n", + "ddata2 = ddata.copy(space='system')\n", + "\n", + "tint = time[1] - time[0]\n", + "dm = numpy.arange(time.size)*1.0\n", + "dm *= tint / 4.15e-3 / ((freq[0]/1e9)**-2 - (freq[-1]/1e9)**-2)\n", + "\n", + "pylab.imshow(ddata2, extent=(time[0], time[-1], dm[-1], dm[0]))\n", + "pylab.axis('auto')\n", + "pylab.xlabel('Time [s]')\n", + "pylab.ylabel('DM [pc cm$^{-3}$]')\n", + "pylab.yticks(numpy.arange(0.0, 2.5, 0.625)); None" + ] + }, + { + "cell_type": "markdown", + "id": "a307015b", + "metadata": { + "id": "a307015b" + }, + "source": [ + "## bifrost.linalg.LinAlg\n", + "\n", + "The final useful function in Bifrost that we will explore is `bifrost.linalg.LinAlg`. This function implements a variety of matrix-matrix operations. It supports:\n", + "\n", + " * $C = \\alpha A × B + \\beta C$\n", + " * $C = \\alpha A × A^H + \\beta C$ (if $B$ is not provided)\n", + " * $C = \\alpha B^H × B + \\beta C$ (if $A$ is not provided)\n", + "\n", + "where $\\alpha$ and $\\beta$ are scalar values, $×$ is a matrix product, and $·^{H}$ denotes a Hermetian transpose. For matricies with more than two dimensions the semantics are the same as for `numpy.matmul`: The last two dims represent the matrix, and all other dimensions are used as batch dimensions to be matched or broadcast between $A$ and $B$.\n", + "\n", + "These three operations make this function useful for implementing simple beamformers or cross-correlation operations. For a beamformer:" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "95844ac9", + "metadata": { + "id": "95844ac9", + "outputId": "d65a46ce-4ab9-4219-d2ac-63b01b48aedc", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "numpy.matmul: -0.06674242\n", + "numpy manual: -0.06674248\n", + "bifrost: -0.06674242\n" + ] + } + ], + "source": [ + "data = numpy.random.randn(1000, 32, 48) # time, channel, input\n", + "data = data.astype(numpy.float32) # beam, channel input\n", + "coeffs = numpy.ones((1, 32, 48))\n", + "for i in range(coeffs.shape[1]):\n", + " coeffs[:,i] = i/32.0\n", + "coeffs = coeffs.astype(numpy.float32)\n", + "beam = numpy.matmul(coeffs.transpose(1,0,2), data.transpose(1,2,0))\n", + "beam = beam.transpose(2,0,1) # time, channel, beam\n", + "print('numpy.matmul:', beam[0,10,0])\n", + "print('numpy manual:', (data[0,10,:]*coeffs[0,10,:]).sum())\n", + "\n", + "data = bifrost.ndarray(data, space='cuda')\n", + "coeffs = bifrost.ndarray(coeffs, space='cuda')\n", + "beam = bifrost.ndarray(shape=(32,1,1000), dtype=numpy.float32,\n", + " space='cuda')\n", + "l = bifrost.linalg.LinAlg()\n", + "beam = l.matmul(1.0, coeffs.transpose(1,0,2), data.transpose(1,2,0),\n", + " 0.0, beam)\n", + "beam2 = beam.copy(space='system')\n", + "beam2 = beam2.transpose(2, 0, 1)\n", + "print('bifrost:', beam2[0,10,0])" + ] + }, + { + "cell_type": "markdown", + "id": "a59c251e", + "metadata": { + "id": "a59c251e" + }, + "source": [ + "This example illustrates one of the complexities when dealing with real data. The axis order that makes the most sense for some operations may not be the best match for other operations. Luckily `bifrost.linalg.LinAlg` supports at least some on-the-fly transpose operations and an explict transpose may not be necessary." + ] + }, + { + "cell_type": "markdown", + "id": "48298668", + "metadata": { + "id": "48298668" + }, + "source": [ + "## Remaining Functions\n", + "\n", + "The remaining functions of `bifrost.fir`, `bifrost.romein`, `bifrost.quantize`, and `bifrost.unpack` will not be addressed here. However, `bifrost.quantize` and `bifrost.unpack` will be used later in the tutorial." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + }, + "colab": { + "name": "01_useful_functions.ipynb", + "provenance": [] + }, + "accelerator": "GPU", + "gpuClass": "standard" + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/02_building_complexity.ipynb b/tutorial/02_building_complexity.ipynb new file mode 100644 index 000000000..c0f3ecd0b --- /dev/null +++ b/tutorial/02_building_complexity.ipynb @@ -0,0 +1,457 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "8ccf096e", + "metadata": { + "id": "8ccf096e" + }, + "source": [ + "# Building Complexity\n", + "\n", + "\"Open\n", + "\n", + "The previous notebooks have shown how to work with data in Bifrost and highlighted several of its features. We are now going to use that to build a more complete example of how data reduction can be done with Bifrost.\n", + "\n" + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError:\n", + " try:\n", + " import google.colab\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure && make -j all && sudo make install)\n", + " import bifrost\n", + " except ModuleNotFoundError:\n", + " print(\"Sorry, could not import bifrost and we're not on colab.\")" + ], + "metadata": { + "id": "yMAWWv40Qn9w" + }, + "id": "yMAWWv40Qn9w", + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Let's start by taking in a collection of time domain complex voltage data for 16 inputs, transforming it to the frequency domain, and creating integrated spectra. First, we need a time domain signal:" + ], + "metadata": { + "id": "gwCX2hrVQj7F" + }, + "id": "gwCX2hrVQj7F" + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "f785410a", + "metadata": { + "id": "f785410a", + "outputId": "db9d1f13-b076-43e5-a0fc-e83feee878e9", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 279 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9d7xdVZ3+/16n19vSG0lIICQUQQM66mAZ/YEI6jijwvwcdeSHvYzjFGbUUWbE0a9fyziAgoKIjhSlCIIgLTQpKaSQQHq7N7e3U3dfvz/W3vucc0tyE27Jyd3P65VX7j33nH3W2Xuf9azn+ZQlpJQECBAgQIAAAKGpHkCAAAECBDh+EJBCgAABAgTwEZBCgAABAgTwEZBCgAABAgTwEZBCgAABAgTwEZnqAbwazJw5Uy5ZsmSqhxEgQIAAdYX169f3SClnjfS3uiQFIcQlwCXLly9n3bp1Uz2cAAECBKgrCCH2j/a3urSPpJT3SSk/0djYONVDCRAgQIATCnVJCgECBAgQYGIQkEKAAAECBPBR9zGFAAECBJgomKZJa2srmqZN9VCOCYlEgoULFxKNRsf8GlHPvY9Wr14tg0BzgAABJgp79+4lm80yY8YMhBBTPZyjgpSS3t5e8vk8S5curfmbEGK9lHL1SK8L7KMAAQIEGAWaptUlIQAIIZgxY8ZRq5yAFAIECBDgMKhHQvBwLGMPSCFAgAA+pJTcub6VsmFP9VACTBHqkhSEEJcIIW4YHByc6qEECHBCYU9PkS//ZhOPvtI51UMJ4OLjH/84s2fP5owzzvAf+8Y3vsGCBQs4++yzOfvss3nggQfG7f3qkhSC4rUAASYGmqkUQqAUjh987GMf48EHHxz2+Je+9CU2btzIxo0bueiii8bt/eqSFAIECDAxMG2VjahbzhSPJICH888/n5aWlkl7v7qsUwgQIMDEwLQVGRgBKQzDVfdtZduh3Lgec9X8Br5+yenH9NprrrmGW265hdWrV/O9732P5ubmcRlToBQCBAjgw3T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EOoNFU0Rs0X0cgs96u3/8VP8914ru8XBlJMv1OBH5P79g2h0i0iQit4rIUZFx3CYiR9bx5z0NxEWkx//8sxi/EGD1vPxnRJvaLCLfq+d9hv0XoykY5ioJKTcmehL4Z3Tpkjcppf4iImf6v69BZ8ZeJyKnAMPoUhRHoe//u4G7JrnWxegSC8eJSAy4XUR+5792NLASeBa4HThZRO4ArgbOV0rdKSLNQAZdcuLvgX8SkYOAuFKq3h3/tcDrgHv8MWerXv+siHyo+k1KqY8AHxHdjOhPwFfrvJ5hP8UIBcNcpcJ85PsUnla67j7oOi9nohdRgDRaSDQBP1N+3SQRqade05nAqojdvsX/rBxwh/JrV/lCaim6NPYWpdSdUC6eJiLXAB8WkX9Flx+4Ygp/74/RguYQdNmDk6pe/1elVNAHpMKn4GsXPwS+oJSaTAAa9nOMUDA8nxiO/CzAfymlvhU9QaraKlZRoGxSjVd91juVUhXFxETkVCp37EUmeKaUUiMiciO6QcrrmaA6bo33bhWRPPAS4N2MFQoT8VFgk1LKmI4Mk2J8CobnK78F3iy6lwAiskB03f5bgVf5EThNwDmR9zxFeaE+r+qz3iG6DDUicpBf2XM8HgN6ReQ4//wm0SWzQTuLvwzcqXQ3rKnwEeDflFLFet8gIuegq/G+a4rXMuynGE3B8LxEKfU7ETkU+LPv+x0C3qiUultErkZH72xHl74O+BzwY9FdwH4dOf5dtFnobt8U08cEbVqVUjkROR/4iogk0P6EM4AhpdRdIjIATHnXrpT6v6m+B/gXdLetO/x5uM73MxgMNTFVUg37NSLyUfRi/blZut58dKOTQ2qFzIpuILS6KiS1UWN5yr/WbDWGMcwBjPnIYJglROTv0D2SPzhBDkUGODtIXmvQOILILReYq7kchgZhNAWDwWAwhBhNwWAwGAwhRigYDAaDIcQIBYPBYDCEGKFgMBgMhhAjFAwGg8EQ8v8BJR9KvGBgyL8AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "import numpy\n", + "\n", + "ninput = 16\n", + "nchan = 256\n", + "ntime = nchan*32\n", + "\n", + "def make_data(ntime, ninput):\n", + " time = numpy.arange(ntime) / 19.6e6\n", + " data = numpy.random.randn(ntime, ninput)\n", + " data = data + 1j*numpy.random.randn(ntime, ninput)\n", + "\n", + " for freq,amp in ((-5e6,2), (3e6,3), (8e6,1)):\n", + " for i in range(ninput):\n", + " data[:,i] += amp*(1+i/ninput)*numpy.exp(2j*numpy.pi*freq*time)\n", + " data = data.astype(numpy.complex64)\n", + " return time, data\n", + "\n", + "t, data = make_data(ntime, ninput)\n", + "\n", + "import pylab\n", + "fdata = numpy.fft.fft(data[:nchan], axis=0)\n", + "freq = numpy.fft.fftfreq(fdata.shape[0], d=1/19.6e6)\n", + "pylab.semilogy(freq/1e6, numpy.abs(fdata[:,ninput-1])**2,\n", + " label=str(ninput-1))\n", + "pylab.semilogy(freq/1e6, numpy.abs(fdata[:,0])**2,\n", + " label='0')\n", + "pylab.xlabel('Frequency [MHz]')\n", + "pylab.ylabel('Power')\n", + "pylab.legend(loc=0);" + ] + }, + { + "cell_type": "markdown", + "id": "3867d3f8", + "metadata": { + "id": "3867d3f8" + }, + "source": [ + "That seems to be working with a quick check of the data using `numpy.fft.fft` and we can even see the different tone amplitudes across the inputs.\n", + "\n", + "Now to translate this into Bifrost and do the integration in time:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "a6b958da", + "metadata": { + "id": "a6b958da", + "outputId": "1bdae1d9-4fac-4fa9-8272-b0224faaec38", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 279 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQV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ivYFYpVSoLf7ngWuA94zM5/3OPyQi9/pfpJRaCCwUvRnR28D/hpifpZNijYKlvVLPfWTGFPYrHXcfdJyXCehKFCARbSSSgBeViZskIqHEa5oA9PPx26eYe10A1igTu8oYqSJ0aOzDSqm14A2eJiJ/Au4TkbvQ4QeevITf+xza0PRBhz0Y5nf+LqWUex+QemMKpnfxe+AXSqmmDKClk2ONgqUjcdrnswA/VUr92jeB+G2r6EcNXpdqrN+9vqOUqhdMTERGU7/FXksj75RS6oyILEdvkDKTRqLjBrj2YxG5CIwHvktDo9AY9wMHlVLWdWRpEjumYOmovAbcJHovAUSki+i4/SuAGWYGThIw1eeafXgr6qv97vVN0WGoEZHeJrJnMD4A8kRkoEmfJDpkNujB4l8Ba5XeDetSWAj8QClVG+oFIjIVHY133iXmZemk2J6CpUOilFomIqXASjP2ewqYpZTaICJL0LN3jqJDX7t5GHhO9C5gL/scX4R2C20wrphqGtmmVSl1QUS+CvyPiMShxxMuB04ppdaLyEngklvtSql/Xeo1wPfRu22tMXpYasYZLJaA2Ciplk6NiNyPrqwfjlB++eiNTvoEmjIregOhKr8pqeGSZZ/JK1Ibw1jaAdZ9ZLFECBG5Ab1H8oJG1lCcBa5wL14LkxzumVtRQHtdy2EJE7anYLFYLBYPtqdgsVgsFg/WKFgsFovFgzUKFovFYvFgjYLFYrFYPFijYLFYLBYP/w8Eey7rSMk6UwAAAABJRU5ErkJggg==\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "data = bifrost.ndarray(data, space='cuda')\n", + "data = data.reshape(-1,nchan,ninput)\n", + "fdata = bifrost.ndarray(shape=data.shape, dtype=data.dtype, space='cuda')\n", + "\n", + "fft = bifrost.fft.Fft()\n", + "fft.init(data, fdata, axes=1, apply_fftshift=True)\n", + "fft.execute(data, fdata)\n", + "\n", + "spectra = bifrost.ndarray(shape=(1,nchan,ninput), dtype=numpy.float32,\n", + " space='cuda')\n", + "bifrost.reduce(fdata, spectra, 'pwrmean')\n", + "\n", + "spectra = spectra.copy(space='system')\n", + "spectra = spectra[0,:,:]\n", + "bf_freq = numpy.fft.fftshift(freq)\n", + "pylab.semilogy(bf_freq/1e6, spectra[:,ninput-1],\n", + " label=str(ninput-1))\n", + "pylab.semilogy(bf_freq/1e6, spectra[:,0],\n", + " label='0')\n", + "pylab.xlabel('Frequency [MHz]')\n", + "pylab.ylabel('Power')\n", + "pylab.legend(loc=0);" + ] + }, + { + "cell_type": "markdown", + "id": "f9a5fe2f", + "metadata": { + "id": "f9a5fe2f" + }, + "source": [ + "This works for a single batch of data, what we call a \"gulp\" in Bifrost. How do we extend this for working on a continuous stream of data? We can first start by wrapping everything in a `for` loop as a stand-in for continuous data:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "366ab2a4", + "metadata": { + "id": "366ab2a4", + "outputId": "3b43ad50-bf56-4e42-e7c9-67b8b0a76874", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 279 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9fXRU5b34+3n23vOWNwiBgCS8GogIwZQClVVFWOgyYLTrsA4v3t5eLFTBQl16lFZbsEHv72i92l652KO9rZbTswrH0yroXRCKttCWcwqlZUClWFAihPeEhLzN7Nkvz/1jTyakvCQqmclkns9aLjPP7L3z3WRmf5/vu5BSolAoFAoFgJZqARQKhULRe1BKQaFQKBQJlFJQKBQKRQKlFBQKhUKRQCkFhUKhUCQwUi3A52HgwIFy5MiRqRZDoVAo0oq//OUvdVLKQZd7Ly2VghDibuDukpIS9u7dm2pxFAqFIq0QQnxypffS0n0kpXxbSvlAv379Ui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MIxmHKCHjzSaMUJEbsKIkXzvEHsoTgFL+zavRUmOvpVbdmC87uXQRAndU9BoNBpNCN1T0Gg0Gk0IbRQ0Go1GE0IbBY1Go9GE0EZBo9FoNCG0UdBoNBpNiP8FcKmXgb4RW9wAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "for gulp in range(5):\n", + " t, data_noise = make_data(ntime, ninput)\n", + " \n", + " data_gpu = bifrost.ndarray(data_noise, space='cuda')\n", + " data_gpu = data_gpu.reshape(-1,nchan,ninput)\n", + " fdata = bifrost.ndarray(shape=data_gpu.shape, dtype=data_gpu.dtype,\n", + " space='cuda')\n", + " \n", + " fft = bifrost.fft.Fft()\n", + " fft.init(data_gpu, fdata, axes=1, apply_fftshift=True)\n", + " fft.execute(data_gpu, fdata)\n", + " \n", + " spectra = bifrost.ndarray(shape=(1,nchan,ninput), dtype=numpy.float32,\n", + " space='cuda')\n", + " bifrost.reduce(fdata, spectra, 'pwrmean')\n", + "\n", + " spectra = spectra.copy(space='system')\n", + " spectra = spectra[0,:,:]\n", + " freq = numpy.fft.fftfreq(nchan, d=1/19.6e6)\n", + " bf_freq = numpy.fft.fftshift(freq)\n", + " pylab.semilogy(bf_freq/1e6, spectra[:,ninput-1],\n", + " label=f\"{ninput-1}@{gulp}\")\n", + " pylab.semilogy(bf_freq/1e6, spectra[:,0],\n", + " label=f\"0@{gulp}\")\n", + "pylab.xlabel('Frequency [MHz]')\n", + "pylab.ylabel('Power')\n", + "pylab.legend(loc=0);" + ] + }, + { + "cell_type": "markdown", + "id": "e258984c", + "metadata": { + "id": "e258984c" + }, + "source": [ + "That works but it is not very efficient. For every gulp we are creating new arrays on both the CPU and GPU memories and creating new `bifrost.fft` instances. One way to deal with this is to pre-initialize the data arrays and the FFT function, and then use `bifrost.ndarray.copy_array` to copy data:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "cf2f6ec8", + "metadata": { + "id": "cf2f6ec8", + "outputId": "caab2b3b-0833-4bc4-a468-1e7d8fb0d59e", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 279 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9e3hU9b3/+/quteaWTCAhISAJF2k0IhezKVD5VREf9BEw2t/m2Vz89fRgYStYqI9updUW3EHP+Wk92v7kh93a02rZPU9hu1sF/T0QirawLacHSjfBC1JBiSThEhIIuczMmnX5nj/WZJKUW1Qyk8l8X8/j48yaNSufxcya9/pcvp+PkFKiUCgUCgWAlm4DFAqFQtF/UKKgUCgUiiRKFBQKhUKRRImCQqFQKJIoUVAoFApFEiPdBnwZioqK5JgxY9JthkKhUGQUf/nLX5qklEMv9FpGioIQ4i7grrKyMvbt25ducxQKhSKjEEJ8drHXMjJ8JKV8S0p5/+DBg9NtikKhUAwoMlIUFAqFQtE3KFFQKBQKRZKMzClcCsuyqK+vJxaLpduUtBAMBiktLcXn86XbFIVCkYEMOFGor68nLy+PMWPGIIRItzkpRUpJc3Mz9fX1XH311ek2R6FQZCADLnwUi8UoLCzMOkEAEEJQWFiYtV6SQqH48gw4UQCyUhA6yeZzVygUX54BKQoKheKLIaXkjVf/lZaWtnSbokgTGSkKQoi7hBA/O3fuXLpNUSgGFLv/uJNBo9fy+y0vp9sURZrISFHo74vXlixZQnFxMRMmTEhuq6qqoqSkhIqKCioqKti6dWuP9+zfv5+FCxcyceJEpk6dSlVVFdFotMc+Tz/9NGVlZZSXl7N9+/aUnIsiu4hEmgEQUnkK2UpGikJ/595776W6uvq87Q8//DA1NTXU1NQwd+7c5PY333yTlStX8tBDD/Hee++xe/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FyD3iN5dT9rKFqBRd2L12IkR/fMLScwXNdyGGKE6SkYDAaDIYzpKRgMBoMhjDEKBoPBYAhjjILBYDAYwhijYDAYDIYwxigYDAaDIcz/A/Lbqu8lywGJAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "from bifrost.ndarray import copy_array\n", + "\n", + "data_gpu = bifrost.ndarray(shape=(ntime//nchan, nchan, ninput),\n", + " dtype=numpy.complex64,\n", + " space='cuda')\n", + "fdata = bifrost.ndarray(shape=data_gpu.shape, dtype=data_gpu.dtype,\n", + " space='cuda')\n", + "spectra_gpu = bifrost.ndarray(shape=(1,nchan,ninput), dtype=numpy.float32,\n", + " space='cuda')\n", + "spectra_cpu = bifrost.ndarray(shape=(1,nchan,ninput), dtype=numpy.float32,\n", + " space='system')\n", + "\n", + "fft = bifrost.fft.Fft()\n", + "fft.init(data_gpu, fdata, axes=1, apply_fftshift=True)\n", + "\n", + "for gulp in range(5):\n", + " t, data_noise = make_data(ntime, ninput)\n", + " data_noise = bifrost.ndarray(data_noise, space='system')\n", + " \n", + " data_gpu = data_gpu.reshape(ntime,ninput)\n", + " copy_array(data_gpu, data_noise)\n", + " data_gpu = data_gpu.reshape(-1,nchan,ninput)\n", + " \n", + " fft.execute(data_gpu, fdata)\n", + " \n", + " bifrost.reduce(fdata, spectra_gpu, 'pwrmean')\n", + "\n", + " copy_array(spectra_cpu, spectra_gpu)\n", + " \n", + " freq = numpy.fft.fftfreq(nchan, d=1/19.6e6)\n", + " bf_freq = numpy.fft.fftshift(freq)\n", + " pylab.semilogy(bf_freq/1e6, spectra_cpu[0,:,ninput-1],\n", + " label=f\"{ninput-1}@{gulp}\")\n", + " pylab.semilogy(bf_freq/1e6, spectra_cpu[0,:,0],\n", + " label=f\"0@{gulp}\")\n", + "pylab.xlabel('Frequency [MHz]')\n", + "pylab.ylabel('Power')\n", + "pylab.legend(loc=0)\n", + "\n", + "del data_gpu\n", + "del fdata\n", + "del spectra_gpu\n", + "del spectra_cpu\n", + "del fft" + ] + }, + { + "cell_type": "markdown", + "id": "04c8036a", + "metadata": { + "id": "04c8036a" + }, + "source": [ + "This works well if you have a fixed channelization or integration time. For pipelines where those parameters could change an alternative to pre-initilization is to wrap the data copies and FFT initialization in `try...except NameError` blocks:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "299a81ed", + "metadata": { + "id": "299a81ed", + "outputId": "18cb8c81-ac93-4055-aae4-bee6bb2a9d60", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 279 + } + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9e3RUdZr3+/ntveuWVEJiICAJFzGYRi6mEVCnFeFFXwHRPsMZLr59+mDDKNjQLh1lWmfACbre1vZoz8jBGe3TrcPMOQ3jTCvovBAa7QndTc+CpocCFVFouYVrEnJP1a59+Z0/dqWSNLeoVCqV+n3WYpHatffOU6mq/d3P5fc8QkqJQqFQKBQAWroNUCgUCkXfQYmCQqFQKJIoUVAoFApFEiUKCoVCoUiiREGhUCgUSYx0G/BVGDhwoBw5cmS6zVAoFIqM4ve//32dlHLQxZ7LSFEQQtwH3FdWVsaePXvSbY5CoVBkFEKIY5d6LiPDR1LK96SUDw8YMCDdpigUCkW/IiNFQaFQKBSpQYmCQqFQKJJkZE7hcliWRU1NDbFYLN2mpIVgMEhpaSk+ny/dpigUigyk34lCTU0NeXl5jBw5EiFEus3pVaSU1NfXU1NTw3XXXZducxQKRQbS78JHsViMoqKirBMEACEERUVFWeslKRSKr06/EwUgKwWhg2x+7QqF4qvTL0VBoVB8ORzH4Z31z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sNcAl6ta1nLD2st8YZDIZeMVFSDaMaEbkGXVnfkKL88tALnVT2NmVW9AJCtd2mpCZLlvetvFK1MIxhBGDcRwZDihCR09BrJF/VzzcUjcDRHR+vJUmOjplbTmCkfsthSBKmp2AwGAyGGKanYDAYDIYYxigYDAaDIYYxCgaDwWCIYYyCwWAwGGIYo2AwGAyGGP8PeRajP+9ig/cAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + } + } + ], + "source": [ + "from bifrost.ndarray import copy_array\n", + "\n", + "for gulp in range(5):\n", + " t, data_noise = make_data(ntime, ninput)\n", + " data_noise = bifrost.ndarray(data_noise, space='system')\n", + " \n", + " try:\n", + " data_gpu = data_gpu.reshape(*data_noise.shape)\n", + " copy_array(data_gpu, data_noise)\n", + " except NameError:\n", + " data_gpu = data_noise.copy(space='cuda')\n", + " data_gpu = data_gpu.reshape(-1,nchan,ninput)\n", + " \n", + " try:\n", + " fft.execute(data_gpu, fdata)\n", + " except NameError:\n", + " fdata = bifrost.ndarray(shape=data_gpu.shape,\n", + " dtype=data_gpu.dtype,\n", + " space='cuda')\n", + " \n", + " fft = bifrost.fft.Fft()\n", + " fft.init(data_gpu, fdata, axes=1, apply_fftshift=True)\n", + " fft.execute(data_gpu, fdata)\n", + " \n", + " try:\n", + " bifrost.reduce(fdata, spectra_gpu, 'pwrmean')\n", + " except NameError:\n", + " spectra_gpu = bifrost.ndarray(shape=(1,nchan,ninput),\n", + " dtype=numpy.float32,\n", + " space='cuda')\n", + " \n", + " bifrost.reduce(fdata, spectra_gpu, 'pwrmean')\n", + " \n", + " try:\n", + " copy_array(spectra_cpu, spectra_gpu)\n", + " except NameError:\n", + " spectra_cpu = spectra_gpu.copy(space='system')\n", + " \n", + " freq = numpy.fft.fftfreq(nchan, d=1/19.6e6)\n", + " bf_freq = numpy.fft.fftshift(freq)\n", + " pylab.semilogy(bf_freq/1e6, spectra_cpu[0,:,ninput-1],\n", + " label=f\"{ninput-1}@{gulp}\")\n", + " pylab.semilogy(bf_freq/1e6, spectra_cpu[0,:,0],\n", + " label=f\"0@{gulp}\")\n", + "pylab.xlabel('Frequency [MHz]')\n", + "pylab.ylabel('Power')\n", + "pylab.legend(loc=0)\n", + "\n", + "del fft\n", + "del data_gpu\n", + "del fdata\n", + "del spectra_gpu\n", + "del spectra_cpu" + ] + }, + { + "cell_type": "markdown", + "id": "d76f47db", + "metadata": { + "id": "d76f47db" + }, + "source": [ + "This structure allows you to initialize each array on the GPU only once and then reuse it as needed. The only catch is that you need to cleanup after you are done processing gulps. Otherwise, you can run into dimension mis-matches if the channel count or integration time changes.\n", + "\n", + "These two examples are what are called \"blocks\" in Bifrost terminology and represent \"atomic units\" of data processing. In the next section we will look at how Bifrost joins blocks together to build a pipeline." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + }, + "colab": { + "name": "02_building_complexity.ipynb", + "provenance": [] + }, + "accelerator": "GPU", + "gpuClass": "standard" + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/03_putting_it_together.ipynb b/tutorial/03_putting_it_together.ipynb new file mode 100644 index 000000000..cb51882ec --- /dev/null +++ b/tutorial/03_putting_it_together.ipynb @@ -0,0 +1,319 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "fcdf1912", + "metadata": { + "id": "fcdf1912" + }, + "source": [ + "# Putting it Together\n", + "\n", + "In the previous section we introduced blocks, the fundamental building blocks of a pipeline in Bifrost. Now we will demonstrate how blocks are connected together and some of the considerations.\n", + "\n", + "\"Open" + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError:\n", + " try:\n", + " import google.colab\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure && make -j all && sudo make install)\n", + " import bifrost\n", + " except ModuleNotFoundError:\n", + " print(\"Sorry, could not import bifrost and we're not on colab.\")" + ], + "metadata": { + "id": "peQUakK6aJPV" + }, + "id": "peQUakK6aJPV", + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "In Bifrost blocks are connected together by circular memory buffers called \"rings\". Like a `bifrost.ndarray`, a ring exists in a memory space: `system`, `cuda_host`, or `cuda`. A ring also has a size that is based on a integer number of segments of the gulp size for the ring.\n", + "\n", + "To create a ring in Bifrost:" + ], + "metadata": { + "id": "wTG9NYJcaFdo" + }, + "id": "wTG9NYJcaFdo" + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "e8f5bda6", + "metadata": { + "id": "e8f5bda6", + "outputId": "e3efb2d4-75ec-410e-af51-92d53b26ea58", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "name: b'a_ring' , space: system\n" + ] + } + ], + "source": [ + "ring = bifrost.ring.Ring(name=\"a_ring\", space=\"system\")\n", + "print('name:', ring.name, ', space:', ring.space)" + ] + }, + { + "cell_type": "markdown", + "id": "bac3cc61", + "metadata": { + "id": "bac3cc61" + }, + "source": [ + "This creates a new ring, called `\"a_ring\"`, in the system memory space. Although the ring has been created it does not yet have any memory allocated to it. To allocate memory you `resize` it:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "705c4df0", + "metadata": { + "id": "705c4df0" + }, + "outputs": [], + "source": [ + "ring.resize(4096)" + ] + }, + { + "cell_type": "markdown", + "id": "de11b932", + "metadata": { + "id": "de11b932" + }, + "source": [ + "This sets the gulp size for the ring to 4096 bytes and this call sets the total ring size to four, 4096 byte buffer. You can change the buffer fraction by adding in a second argument which is the total ring size. For example, to increase the buffer size to five segments:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "26c0d06f", + "metadata": { + "id": "26c0d06f" + }, + "outputs": [], + "source": [ + "ring.resize(4096, 5*4096)" + ] + }, + { + "cell_type": "markdown", + "id": "9c8c0212", + "metadata": { + "id": "9c8c0212" + }, + "source": [ + "Resizing a ring is a data-safe process and the contents of the ring are preserved.\n", + "\n", + "Rings in Bifrost are more than just a section of memory, though. It has a few other attributes that make it useful for representing a stream of data:\n", + "\n", + " * a timetag that denotes when the stream of data starts\n", + " * a header that stores metadata about the sequence\n", + " * they support single writer/multi-reader access for branching pipelines\n", + "\n", + "Let's use an example to look at these first two. In this we will write some data to the ring:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "f74b9145", + "metadata": { + "id": "f74b9145", + "outputId": "bbb06dcf-b257-4840-a629-d4ed3b56288e", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "0 @ [[120 29 45 ... 68 113 43]]\n", + "1 @ [[ 41 69 98 ... 65 62 112]]\n", + "2 @ [[ 16 77 117 ... 20 56 38]]\n", + "3 @ [[ 74 63 107 ... 82 101 122]]\n", + "4 @ [[ 30 76 106 ... 93 97 78]]\n", + "5 @ [[ 33 119 119 ... 67 12 32]]\n", + "6 @ [[106 101 24 ... 89 104 62]]\n", + "7 @ [[26 6 1 ... 75 32 17]]\n", + "8 @ [[101 66 103 ... 116 34 112]]\n", + "9 @ [[ 14 31 70 ... 23 109 119]]\n", + "10 @ [[101 119 26 ... 3 74 43]]\n", + "11 @ [[ 76 109 16 ... 31 46 66]]\n", + "12 @ [[ 10 42 90 ... 99 38 126]]\n", + "13 @ [[ 42 86 40 ... 109 57 96]]\n", + "14 @ [[ 13 61 5 ... 13 2 113]]\n", + "15 @ [[ 86 82 79 ... 98 119 17]]\n", + "16 @ [[ 12 66 117 ... 16 75 20]]\n", + "17 @ [[ 68 50 3 ... 114 22 95]]\n", + "18 @ [[ 58 98 60 ... 73 108 86]]\n", + "19 @ [[ 6 56 76 ... 115 107 44]]\n" + ] + } + ], + "source": [ + "import json, numpy, time\n", + "\n", + "ring = bifrost.ring.Ring(name=\"another_ring\", space=\"system\")\n", + "\n", + "with ring.begin_writing() as output_ring:\n", + " time_tag = int(time.time()*1e9)\n", + " hdr = {'time_tag': time_tag,\n", + " 'metadata': 'here',\n", + " 'more_metadata': 'there'}\n", + " hdr_str = json.dumps(hdr)\n", + " \n", + " gulp_size = 4096\n", + " ring.resize(gulp_size, 5*gulp_size)\n", + " \n", + " with output_ring.begin_sequence(time_tag=hdr['time_tag'],\n", + " header=hdr_str) as output_seq:\n", + " for i in range(20):\n", + " with output_seq.reserve(gulp_size) as output_span:\n", + " data = output_span.data_view(numpy.int8)\n", + " data[...] = (numpy.random.rand(gulp_size)\\\n", + " *127).astype(numpy.int8)\n", + " print(i, '@', data[:5])" + ] + }, + { + "cell_type": "markdown", + "id": "21f9db4d", + "metadata": { + "id": "21f9db4d" + }, + "source": [ + "Here we:\n", + "\n", + " 1. Ready the ring for writing with `ring.begin_writing()`.\n", + " 2. Once the ring is ready for writing, we define the time tag for the first sample and a dictionary of metadata. The time tag is expected to be an integer and the dictionary is dumped to a JSON object.\n", + " 3. Start a \"sequence\" on the ring using that time tag and JSON object. \n", + " * In Bifrost a sequence is a stream of data with a single observational setup.\n", + " 4. Loop over spans, also called gulps, in the output sequence and writes data to the ring.\n", + " * Writing uses a `data_view` of the span/gulp that exposes it as a `bifrost.ndarray`.\n", + "\n", + "Reading from a ring follows a similar sequence:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "223c1f23", + "metadata": { + "id": "223c1f23", + "outputId": "47e90b11-3029-436f-d82c-df3295b32bc2", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "1656354526479179008\n", + "{'time_tag': 1656354526479179008, 'metadata': 'here', 'more_metadata': 'there'}\n", + "12 @ [[ 10 42 90 ... 99 38 126]]\n", + "13 @ [[ 42 86 40 ... 109 57 96]]\n", + "14 @ [[ 13 61 5 ... 13 2 113]]\n", + "15 @ [[ 86 82 79 ... 98 119 17]]\n", + "16 @ [[ 12 66 117 ... 16 75 20]]\n", + "17 @ [[ 68 50 3 ... 114 22 95]]\n", + "18 @ [[ 58 98 60 ... 73 108 86]]\n", + "19 @ [[ 6 56 76 ... 115 107 44]]\n" + ] + } + ], + "source": [ + "for input_seq in ring.read(guarantee=True):\n", + " hdr = json.loads(input_seq.header.tobytes())\n", + " print(input_seq.time_tag)\n", + " print(hdr)\n", + " \n", + " gulp_size = 4096\n", + " \n", + " i = -1\n", + " for input_span in input_seq.read(gulp_size):\n", + " i += 1\n", + " if input_span.size < gulp_size:\n", + " continue\n", + " data = input_span.data_view(numpy.int8)\n", + " print(i, '@', data[:10])" + ] + }, + { + "cell_type": "markdown", + "id": "e11cf55d", + "metadata": { + "id": "e11cf55d" + }, + "source": [ + "Here we:\n", + "\n", + " 1. Open the ring for reading with `ring.read()` and get an iterator over sequences in that ring.\n", + " * This ring was opened with `gaurantee=True` which tells Bifrost that spans that are being read from cannot be overwriten with new data until the reader releases the span.\n", + " 2. For the sequence we can access its `time_tag` and metadata header.\n", + " 3. Loop over spans/gulps within that sequence until the iterator is exhausted.\n", + " * It is possible that a span returned by `input_seq.read()` is smaller than the gulp size, particuarlly at the end of a sequence. It is a good idea to check the size of the span before trying to use it.\n", + " 4. For each span, do the processing that is required.\n", + "\n", + "In the next section we will talk about how to build a complete pipeline from these pieces. " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + }, + "colab": { + "name": "03_putting_it_together.ipynb", + "provenance": [] + }, + "accelerator": "GPU", + "gpuClass": "standard" + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/04_pipelines.ipynb b/tutorial/04_pipelines.ipynb new file mode 100644 index 000000000..918432ba2 --- /dev/null +++ b/tutorial/04_pipelines.ipynb @@ -0,0 +1,460 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "9f6562f1", + "metadata": { + "id": "9f6562f1" + }, + "source": [ + "# Building Pipelines\n", + "\n", + "\"Open\n", + "\n", + "We now have all of the pieces needed to build a complete pipeline in the Bifrost framework. Although it is hard to run a full multi-threaded Bifrost pipeline inside a Jupyter notebook we will look at a few examples." + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError as exn:\n", + " try:\n", + " import google.colab\n", + " except ModuleNotFoundError:\n", + " raise exn\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure --disable-cuda && make -j all && sudo make install)\n", + " import bifrost" + ], + "metadata": { + "id": "DQLLqB44cSUy" + }, + "id": "DQLLqB44cSUy", + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Let's start with a simple pipeline that generates random data in one block and writes it to disk in another. The generator block looks like:" + ], + "metadata": { + "id": "vzyE5ZgOcBwE" + }, + "id": "vzyE5ZgOcBwE" + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "423032b3", + "metadata": { + "id": "423032b3" + }, + "outputs": [], + "source": [ + "import os\n", + "import json\n", + "import time\n", + "import numpy\n", + "import threading\n", + "\n", + "class GeneratorOp(object):\n", + " def __init__(self, oring, ntime_gulp=250, \n", + " shutdown_event=None, core=None):\n", + " self.oring = oring\n", + " self.ntime_gulp = ntime_gulp\n", + " if shutdown_event is None:\n", + " shutdown_event = threading.Event()\n", + " self.shutdown_event = shutdown_event\n", + " self.core = core\n", + " \n", + " def shutdown(self):\n", + " self.shutdown_event.set()\n", + " \n", + " def main(self):\n", + " with self.oring.begin_writing() as oring:\n", + " navg = 24\n", + " tint = navg / 25e3\n", + " tgulp = tint * self.ntime_gulp\n", + " nbeam = 1\n", + " chan0 = 1234\n", + " nchan = 16*184\n", + " npol = 4\n", + " \n", + " ohdr = {'time_tag': int(int(time.time())*196e6),\n", + " 'seq0': 0, \n", + " 'chan0': chan0,\n", + " 'cfreq0': chan0*25e3,\n", + " 'bw': nchan*25e3,\n", + " 'navg': navg,\n", + " 'nbeam': nbeam,\n", + " 'nchan': nchan,\n", + " 'npol': npol,\n", + " 'pols': 'XX,YY,CR,CI',\n", + " 'complex': False,\n", + " 'nbit': 32}\n", + " ohdr_str = json.dumps(ohdr)\n", + " \n", + " ogulp_size = self.ntime_gulp*nbeam*nchan*npol*4 # float32\n", + " oshape = (self.ntime_gulp,nbeam,nchan,npol)\n", + " self.oring.resize(ogulp_size)\n", + " \n", + " prev_time = time.time()\n", + " with oring.begin_sequence(time_tag=ohdr['time_tag'], header=ohdr_str) as oseq:\n", + " while not self.shutdown_event.is_set():\n", + " with oseq.reserve(ogulp_size) as ospan:\n", + " \n", + " odata = ospan.data_view(numpy.float32).reshape(oshape)\n", + " odata[...] = numpy.random.randn(*oshape)\n", + " \n", + " curr_time = time.time()\n", + " while curr_time - prev_time < tgulp:\n", + " time.sleep(0.01)\n", + " curr_time = time.time()" + ] + }, + { + "cell_type": "markdown", + "id": "518b71ec", + "metadata": { + "id": "518b71ec" + }, + "source": [ + "The `GeneratorOp` block is implemented as an object with a `main` method that is intended to be launched via `threading.Thread`. This setup is consistent with the Bifrost asychronous model where each block is asynchronous but operations on spans/gulps within a particular block are synchronous. The `__init__` method sets up the block and defines the ring that is to be used and the CPU core that the `main` method will be bound to when `main` is started. The `main` method does the heavy lifting here. Inside this method:\n", + "\n", + " 1. The output ring is prepared for writing.\n", + " 2. The parameters of the generated data (number of time samples, number of channels, etc.) and other meta data are defined and dumped to a JSON object.\n", + " 3. The output sequence is started.\n", + " 4. The innermost loops starts and puts random data into the output sequence span by span until a shutdown event breaks out of this loop. The speed of iteration through this inner loop is controlled by a call to `time.sleep` so that the data rate can be limited.\n", + "\n", + "The writer block looks like:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "0bb566f8", + "metadata": { + "id": "0bb566f8" + }, + "outputs": [], + "source": [ + "class WriterOp(object):\n", + " def __init__(self, iring, ntime_gulp=250, guarantee=True, core=None):\n", + " self.iring = iring\n", + " self.ntime_gulp = ntime_gulp\n", + " self.guarantee = guarantee\n", + " self.core = core\n", + " \n", + " def main(self):\n", + " for iseq in self.iring.read(guarantee=self.guarantee):\n", + " ihdr = json.loads(iseq.header.tostring())\n", + " \n", + " print(\"Writer: Start of new sequence:\", str(ihdr))\n", + " \n", + " time_tag = ihdr['time_tag']\n", + " navg = ihdr['navg']\n", + " nbeam = ihdr['nbeam']\n", + " chan0 = ihdr['chan0']\n", + " nchan = ihdr['nchan']\n", + " chan_bw = ihdr['bw'] / nchan\n", + " npol = ihdr['npol']\n", + " pols = ihdr['pols']\n", + " pols = pols.replace('CR', 'XY_real')\n", + " pols = pols.replace('CI', 'XY_imag')\n", + " \n", + " igulp_size = self.ntime_gulp*nbeam*nchan*npol*4 # float32\n", + " ishape = (self.ntime_gulp,nbeam,nchan,npol)\n", + " \n", + " prev_time = time.time()\n", + " iseq_spans = iseq.read(igulp_size)\n", + " for ispan in iseq_spans:\n", + " if ispan.size < igulp_size:\n", + " continue # Ignore final gulp\n", + " \n", + " idata = ispan.data_view(numpy.float32).reshape(ishape)\n", + " with open(f\"{time_tag}.dat\", 'wb') as fh:\n", + " fh.write(idata.tobytes())\n", + " print(' ', fh.name, '@', os.path.getsize(fh.name))\n", + " \n", + " time_tag += navg * self.ntime_gulp * (int(196e6) // int(25e3))" + ] + }, + { + "cell_type": "markdown", + "id": "e614dedf", + "metadata": { + "id": "e614dedf" + }, + "source": [ + "The `WriterOp` block is structured in the same was as `GeneratorOp` block but uses the \"input ring\" structure for accessing data.\n", + "\n", + "To run these two blocks as a pipeline you would using the following inside a `if __name__ == '__main__':` block:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "7dfa4ef3", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7dfa4ef3", + "outputId": "b172367c-8c1a-4b99-d58b-f915a814fd2b" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:10: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.\n", + " # Remove the CWD from sys.path while we load stuff.\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Writer: Start of new sequence: {'time_tag': 324645856752000000, 'seq0': 0, 'chan0': 1234, 'cfreq0': 30850000.0, 'bw': 73600000.0, 'navg': 24, 'nbeam': 1, 'nchan': 2944, 'npol': 4, 'pols': 'XX,YY,CR,CI', 'complex': False, 'nbit': 32}\n", + " 324645856752000000.dat @ 11776000\n", + " 324645856799040000.dat @ 11776000\n", + " 324645856846080000.dat @ 11776000\n", + " 324645856893120000.dat @ 11776000\n", + " 324645856940160000.dat @ 11776000\n", + " 324645856987200000.dat @ 11776000\n", + " 324645857034240000.dat @ 11776000\n", + " 324645857081280000.dat @ 11776000\n", + " 324645857128320000.dat @ 11776000\n", + " 324645857175360000.dat @ 11776000\n", + " 324645857222400000.dat @ 11776000\n", + " 324645857269440000.dat @ 11776000\n", + " 324645857316480000.dat @ 11776000\n", + " 324645857363520000.dat @ 11776000\n", + " 324645857410560000.dat @ 11776000\n", + " 324645857457600000.dat @ 11776000\n", + " 324645857504640000.dat @ 11776000\n", + " 324645857551680000.dat @ 11776000\n", + " 324645857598720000.dat @ 11776000\n", + "Done\n" + ] + } + ], + "source": [ + "write_ring = bifrost.ring.Ring(name=\"write\")\n", + "\n", + "ops = []\n", + "ops.append(GeneratorOp(write_ring, ntime_gulp=250, core=0))\n", + "ops.append(WriterOp(write_ring, ntime_gulp=250, core=1))\n", + "\n", + "threads = [threading.Thread(target=op.main) for op in ops]\n", + "for thread in threads:\n", + " thread.start()\n", + " \n", + "# Don't run forever\n", + "time.sleep(3)\n", + "ops[0].shutdown()\n", + "\n", + "for thread in threads:\n", + " thread.join()\n", + "print(\"Done\")" + ] + }, + { + "cell_type": "markdown", + "id": "abc15540", + "metadata": { + "id": "abc15540" + }, + "source": [ + "This creates the ring that connects the two blocks, creates the `threading.Thread` instances that run each block, and starts the blocks.\n", + "\n", + "If you wanted to insert a third block between `GeneratorOp` and `WriterOp` it might look like:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "6519c569", + "metadata": { + "id": "6519c569" + }, + "outputs": [], + "source": [ + "class CopyOp(object):\n", + " def __init__(self, iring, oring, ntime_gulp=250, guarantee=True, core=-1):\n", + " self.iring = iring\n", + " self.oring = oring\n", + " self.ntime_gulp = ntime_gulp\n", + " self.guarantee = guarantee\n", + " self.core = core\n", + " \n", + " def main(self):\n", + " with self.oring.begin_writing() as oring:\n", + " for iseq in self.iring.read(guarantee=self.guarantee):\n", + " ihdr = json.loads(iseq.header.tostring())\n", + " \n", + " print(\"Copy: Start of new sequence:\", str(ihdr))\n", + " \n", + " time_tag = ihdr['time_tag']\n", + " navg = ihdr['navg']\n", + " nbeam = ihdr['nbeam']\n", + " chan0 = ihdr['chan0']\n", + " nchan = ihdr['nchan']\n", + " chan_bw = ihdr['bw'] / nchan\n", + " npol = ihdr['npol']\n", + " pols = ihdr['pols']\n", + " pols = pols.replace('CR', 'XY_real')\n", + " pols = pols.replace('CI', 'XY_imag')\n", + "\n", + " igulp_size = self.ntime_gulp*nbeam*nchan*npol*4 # float32\n", + " ishape = (self.ntime_gulp,nbeam,nchan,npol)\n", + " self.iring.resize(igulp_size, igulp_size*5)\n", + " \n", + " ogulp_size = igulp_size\n", + " oshape = ishape\n", + " self.oring.resize(ogulp_size)\n", + " \n", + " ohdr = ihdr.copy()\n", + " ohdr_str = json.dumps(ohdr)\n", + " \n", + " iseq_spans = iseq.read(igulp_size)\n", + " with oring.begin_sequence(time_tag=time_tag, header=ohdr_str) as oseq:\n", + " for ispan in iseq_spans:\n", + " if ispan.size < igulp_size:\n", + " continue # Ignore final gulp\n", + " \n", + " with oseq.reserve(ogulp_size) as ospan:\n", + " idata = ispan.data_view(numpy.float32)\n", + " odata = ospan.data_view(numpy.float32) \n", + " odata[...] = idata" + ] + }, + { + "cell_type": "markdown", + "id": "8fc149b7", + "metadata": { + "id": "8fc149b7" + }, + "source": [ + "This `CopyOp` block combines the characteristics of reading and writing from rings to copy data from one ring to the other." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "094130bc", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "094130bc", + "outputId": "1f631a9f-5ba4-417e-cfc7-5bf644193787" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:12: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.\n", + " if sys.path[0] == '':\n", + "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:10: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.\n", + " # Remove the CWD from sys.path while we load stuff.\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Copy: Start of new sequence: {'time_tag': 324645857340000000, 'seq0': 0, 'chan0': 1234, 'cfreq0': 30850000.0, 'bw': 73600000.0, 'navg': 24, 'nbeam': 1, 'nchan': 2944, 'npol': 4, 'pols': 'XX,YY,CR,CI', 'complex': False, 'nbit': 32}\n", + "Writer: Start of new sequence: {'time_tag': 324645857340000000, 'seq0': 0, 'chan0': 1234, 'cfreq0': 30850000.0, 'bw': 73600000.0, 'navg': 24, 'nbeam': 1, 'nchan': 2944, 'npol': 4, 'pols': 'XX,YY,CR,CI', 'complex': False, 'nbit': 32}\n", + " 324645857340000000.dat @ 11776000\n", + " 324645857387040000.dat @ 11776000\n", + " 324645857434080000.dat @ 11776000\n", + " 324645857481120000.dat @ 11776000\n", + " 324645857528160000.dat @ 11776000\n", + " 324645857575200000.dat @ 11776000\n", + " 324645857622240000.dat @ 11776000\n", + " 324645857669280000.dat @ 11776000\n", + " 324645857716320000.dat @ 11776000\n", + " 324645857763360000.dat @ 11776000\n", + " 324645857810400000.dat @ 11776000\n", + " 324645857857440000.dat @ 11776000\n", + " 324645857904480000.dat @ 11776000\n", + " 324645857951520000.dat @ 11776000\n", + " 324645857998560000.dat @ 11776000\n", + " 324645858045600000.dat @ 11776000\n", + " 324645858092640000.dat @ 11776000\n", + " 324645858139680000.dat @ 11776000\n", + "Done\n" + ] + } + ], + "source": [ + "copy_ring = bifrost.ring.Ring(name=\"copy\")\n", + "write_ring = bifrost.ring.Ring(name=\"write\")\n", + "\n", + "ops = []\n", + "ops.append(GeneratorOp(copy_ring, ntime_gulp=250, core=0))\n", + "ops.append(CopyOp(copy_ring, write_ring, ntime_gulp=250, core=1))\n", + "ops.append(WriterOp(write_ring, ntime_gulp=250, core=2))\n", + "\n", + "threads = [threading.Thread(target=op.main) for op in ops]\n", + "for thread in threads:\n", + " thread.start()\n", + " \n", + "# Don't run forever\n", + "time.sleep(3)\n", + "ops[0].shutdown()\n", + "\n", + "for thread in threads:\n", + " thread.join()\n", + "print(\"Done\")" + ] + }, + { + "cell_type": "markdown", + "id": "916ef6f2", + "metadata": { + "id": "916ef6f2" + }, + "source": [ + "These examples should provide a starting point for building pipelines in Bifrost. Although the examples run purely on the CPU, GPU versions can also be create, either through copying to GPU memory within each block or by using rings in the `cuda` memory space. If `cuda` rings the user needs to ensure that all memory copies to/from the ring are executed before the span is released. Otherwise, corruption of the ring's contents can happen. In the next section we will look at logging from inside the blocks to help understand performance." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + }, + "colab": { + "name": "04_pipelines.ipynb", + "provenance": [] + }, + "gpuClass": "standard" + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/05_block_logging.ipynb b/tutorial/05_block_logging.ipynb new file mode 100644 index 000000000..180548924 --- /dev/null +++ b/tutorial/05_block_logging.ipynb @@ -0,0 +1,279 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "4548b5b3", + "metadata": { + "id": "4548b5b3" + }, + "source": [ + "# Block Logging\n", + "\n", + "\"Open\n", + "\n", + "In the previous section we looked at how to put blocks and rings together to build a simple pipeline. In this section we will look at the tools Bifrost provides to analyze pipeline performance and how to integrate those into blocks.\n" + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError as exn:\n", + " try:\n", + " import google.colab\n", + " except ModuleNotFoundError:\n", + " raise exn\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure --disable-cuda && make -j all && sudo make install)\n", + " import bifrost" + ], + "metadata": { + "id": "OE9pYXXj-rkG" + }, + "id": "OE9pYXXj-rkG", + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "\n", + "Let's start with the `CopyOp` block from the previous section:" + ], + "metadata": { + "id": "kaj6t0I--pz6" + }, + "id": "kaj6t0I--pz6" + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "84820717", + "metadata": { + "id": "84820717" + }, + "outputs": [], + "source": [ + "import os\n", + "import json\n", + "import time\n", + "import numpy\n", + "import threading\n", + "\n", + "class CopyOp(object):\n", + " def __init__(self, iring, oring, ntime_gulp=250, guarantee=True, core=-1):\n", + " self.iring = iring\n", + " self.oring = oring\n", + " self.ntime_gulp = ntime_gulp\n", + " self.guarantee = guarantee\n", + " self.core = core\n", + " \n", + " def main(self):\n", + " with self.oring.begin_writing() as oring:\n", + " for iseq in self.iring.read(guarantee=self.guarantee):\n", + " ihdr = json.loads(iseq.header.tostring())\n", + " \n", + " print(\"Copy: Start of new sequence:\", str(ihdr))\n", + " \n", + " time_tag = ihdr['time_tag']\n", + " navg = ihdr['navg']\n", + " nbeam = ihdr['nbeam']\n", + " chan0 = ihdr['chan0']\n", + " nchan = ihdr['nchan']\n", + " chan_bw = ihdr['bw'] / nchan\n", + " npol = ihdr['npol']\n", + " pols = ihdr['pols']\n", + " pols = pols.replace('CR', 'XY_real')\n", + " pols = pols.replace('CI', 'XY_imag')\n", + "\n", + " igulp_size = self.ntime_gulp*nbeam*nchan*npol*4 # float32\n", + " ishape = (self.ntime_gulp,nbeam,nchan,npol)\n", + " self.iring.resize(igulp_size, igulp_size*5)\n", + " \n", + " ogulp_size = igulp_size\n", + " oshape = ishape\n", + " self.oring.resize(ogulp_size)\n", + " \n", + " ohdr = ihdr.copy()\n", + " ohdr_str = json.dumps(ohdr)\n", + " \n", + " iseq_spans = iseq.read(igulp_size)\n", + " with oring.begin_sequence(time_tag=time_tag, header=ohdr_str) as oseq:\n", + " for ispan in iseq_spans:\n", + " if ispan.size < igulp_size:\n", + " continue # Ignore final gulp\n", + " \n", + " with oseq.reserve(ogulp_size) as ospan:\n", + " idata = ispan.data_view(numpy.float32)\n", + " odata = ospan.data_view(numpy.float32) \n", + " odata[...] = idata" + ] + }, + { + "cell_type": "markdown", + "id": "18cdb7e1", + "metadata": { + "id": "18cdb7e1" + }, + "source": [ + "If we want to know how this block is performing we can add timing statements to it and record the values using Bifrost's `bifrost.proclog` functionality. This provides a lightweight logger that records information to `/dev/shm/bifrost` where it can be accessed.\n", + "\n", + "To add logging to this block we would update it with:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "cfea96e1", + "metadata": { + "id": "cfea96e1" + }, + "outputs": [], + "source": [ + "from bifrost.proclog import ProcLog\n", + "from bifrost.affinity import get_core, set_core\n", + "\n", + "class CopyOp(object):\n", + " def __init__(self, iring, oring, ntime_gulp=250, guarantee=True, core=-1):\n", + " self.iring = iring\n", + " self.oring = oring\n", + " self.ntime_gulp = ntime_gulp\n", + " self.guarantee = guarantee\n", + " self.core = core\n", + " \n", + " # ProcLog updates:\n", + " self.bind_proclog = ProcLog(type(self).__name__+\"/bind\")\n", + " self.in_proclog = ProcLog(type(self).__name__+\"/in\")\n", + " self.out_proclog = ProcLog(type(self).__name__+\"/out\")\n", + " self.size_proclog = ProcLog(type(self).__name__+\"/size\")\n", + " self.sequence_proclog = ProcLog(type(self).__name__+\"/sequence0\")\n", + " self.perf_proclog = ProcLog(type(self).__name__+\"/perf\")\n", + " \n", + " self.in_proclog.update( {'nring':1, 'ring0':self.iring.name})\n", + " self.out_proclog.update( {'nring':1, 'ring0':self.oring.name})\n", + " self.size_proclog.update({'nseq_per_gulp': self.ntime_gulp})\n", + " \n", + " def main(self):\n", + " set_core(self.core)\n", + " self.bind_proclog.update({'ncore': 1, \n", + " 'core0': get_core(),})\n", + " \n", + " with self.oring.begin_writing() as oring:\n", + " for iseq in self.iring.read(guarantee=self.guarantee):\n", + " ihdr = json.loads(iseq.header.tostring())\n", + " \n", + " self.sequence_proclog.update(ihdr)\n", + " \n", + " print(\"Copy: Start of new sequence:\", str(ihdr))\n", + " \n", + " time_tag = ihdr['time_tag']\n", + " navg = ihdr['navg']\n", + " nbeam = ihdr['nbeam']\n", + " chan0 = ihdr['chan0']\n", + " nchan = ihdr['nchan']\n", + " chan_bw = ihdr['bw'] / nchan\n", + " npol = ihdr['npol']\n", + " pols = ihdr['pols']\n", + " pols = pols.replace('CR', 'XY_real')\n", + " pols = pols.replace('CI', 'XY_imag')\n", + "\n", + " igulp_size = self.ntime_gulp*nbeam*nchan*npol*4 # float32\n", + " ishape = (self.ntime_gulp,nbeam,nchan,npol)\n", + " self.iring.resize(igulp_size, igulp_size*5)\n", + " \n", + " ogulp_size = igulp_size\n", + " oshape = ishape\n", + " self.oring.resize(ogulp_size)\n", + " \n", + " ohdr = ihdr.copy()\n", + " ohdr_str = json.dumps(ohdr)\n", + " \n", + " prev_time = time.time()\n", + " iseq_spans = iseq.read(igulp_size)\n", + " with oring.begin_sequence(time_tag=time_tag, header=ohdr_str) as oseq:\n", + " for ispan in iseq_spans:\n", + " if ispan.size < igulp_size:\n", + " continue # Ignore final gulp\n", + " curr_time = time.time()\n", + " acquire_time = curr_time - prev_time\n", + " prev_time = curr_time\n", + " \n", + " with oseq.reserve(ogulp_size) as ospan:\n", + " curr_time = time.time()\n", + " reserve_time = curr_time - prev_time\n", + " prev_time = curr_time\n", + " \n", + " idata = ispan.data_view(numpy.float32)\n", + " odata = ospan.data_view(numpy.float32) \n", + " odata[...] = idata\n", + " \n", + " curr_time = time.time()\n", + " process_time = curr_time - prev_time\n", + " prev_time = curr_time\n", + " self.perf_proclog.update({'acquire_time': acquire_time, \n", + " 'reserve_time': reserve_time, \n", + " 'process_time': process_time,})" + ] + }, + { + "cell_type": "markdown", + "id": "5c784a96", + "metadata": { + "id": "5c784a96" + }, + "source": [ + "In the `__init__` method of `CopyOp` we define all of the logging monitoring points:\n", + "\n", + " * `bind_proclog` — CPU and GPU binding information\n", + " * `in_proclog` — input ring(s), if any\n", + " * `out_proclog` — output ring(s), if any\n", + " * `size_proclog` — gulp size in use\n", + " * `sequence_proclog` — metadata for the current sequence being processed\n", + " * `perf_proclog` — block performance timing, consisting of:\n", + " * `acquire_time` — time spent waiting to read a span\n", + " * `reserve_time` — time spect waiting to acquire an output span for writing\n", + " * `process_time` — time spent processing data (basically everything else)\n", + "\n", + "For some of these monitoring points, like in, out, and size, the values are known when the block is created and they can be saved during initalization. For others, like sequence and perf, they can only be determined while running inside `main`.\n", + "\n", + "In addition to these explict monitoring points, Bifrost also creates monitoring points for the rings that capture their names, sizes, and space. All of this information is recorded to `/dev/shm/bifrost` in a per-process, per-block/ring fashion. The path would be:\n", + "\n", + " /dev/shm/bifrost///\n", + "\n", + "Bifrost provides tools, like the top-like utility `like_top.py`, that can tap into this information and provide real time information about a running pipeline. The `bifrost.proclog` module also provides methods for accessing these data in a programmatic way." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + }, + "colab": { + "name": "05_block_logging.ipynb", + "provenance": [] + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/06_data_capture.ipynb b/tutorial/06_data_capture.ipynb new file mode 100644 index 000000000..bbea52062 --- /dev/null +++ b/tutorial/06_data_capture.ipynb @@ -0,0 +1,311 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "4336558d", + "metadata": { + "id": "4336558d" + }, + "source": [ + "# Data Capture\n", + "\n", + "\"Open\n", + "\n", + "Next we will look at how to use Bifrost to work with packetized data, either from the network or from packets recorded to a file. This is done through the `bifrost.packet_capture` module.\n", + "\n", + "**NOTE:** This section of the tutorial previews a new packet capture interface that is currently under development in the `ibverb-support` branch." + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError as exn:\n", + " try:\n", + " import google.colab\n", + " except ModuleNotFoundError:\n", + " raise exn\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev librdmacm-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone --branch ibverb-support https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure --disable-hwloc && make -j all && sudo make install)\n", + " import bifrost" + ], + "metadata": { + "id": "2w7kFngftyj2" + }, + "id": "2w7kFngftyj2", + "execution_count": 6, + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "372e7e14", + "metadata": { + "id": "372e7e14" + }, + "outputs": [], + "source": [ + "import json\n", + "import ctypes\n", + "import threading\n", + "\n", + "from bifrost.address import Address\n", + "from bifrost.udp_socket import UDPSocket\n", + "from bifrost.packet_capture import PacketCaptureCallback, UDPCapture\n", + "\n", + "addr = Address('127.0.0.1', 10000)\n", + "sock = UDPSocket()\n", + "sock.bind(addr)\n", + "sock.timeout = 5.0\n", + "\n", + "class CaptureOp(object):\n", + " def __init__(self, log, oring, sock, nsrc=16, src0=0, max_size=9000, ntime_gulp=250, ntime_slot=25000, core=-1):\n", + " self.log = log\n", + " self.oring = oring\n", + " self.sock = sock\n", + " self.nsrc = nsrc\n", + " self.src0 = src0\n", + " self.max_size = max_size\n", + " self.ntime_gulp = ntime_gulp\n", + " self.ntime_slot = ntime_slot\n", + " self.core = core\n", + " self.shutdown_event = threading.Event()\n", + "\n", + " def shutdown(self):\n", + " self.shutdown_event.set()\n", + "\n", + " def seq_callback(\n", + " self, seq0, chan0, nchan, nsrc, time_tag_ptr, hdr_ptr, hdr_size_ptr):\n", + " timestamp0 = int((self.utc_start - ADP_EPOCH).total_seconds())\n", + " time_tag0 = timestamp0 * int(FS)\n", + " time_tag = time_tag0 + seq0 * (int(FS) // int(CHAN_BW))\n", + " print(\"++++++++++++++++ seq0 =\", seq0)\n", + " print(\" time_tag =\", time_tag)\n", + " time_tag_ptr[0] = time_tag\n", + " hdr = {\n", + " \"time_tag\": time_tag,\n", + " \"seq0\": seq0,\n", + " \"chan0\": chan0,\n", + " \"nchan\": nchan,\n", + " \"cfreq\": (chan0 + 0.5 * (nchan - 1)) * CHAN_BW,\n", + " \"bw\": nchan * CHAN_BW,\n", + " \"nstand\": nsrc * 16,\n", + " \"npol\": 2,\n", + " \"complex\": True,\n", + " \"nbit\": 4,\n", + " \"axes\": \"time,chan,stand,pol\",\n", + " }\n", + " print(\"******** CFREQ:\", hdr[\"cfreq\"])\n", + " hdr_str = json.dumps(hdr)\n", + " self.header_buf = ctypes.create_string_buffer(hdr_str)\n", + " hdr_ptr[0] = ctypes.cast(self.header_buf, ctypes.c_void_p)\n", + " hdr_size_ptr[0] = len(hdr_str)\n", + " return 0\n", + "\n", + " def main(self):\n", + " seq_callback = PacketCaptureCallback()\n", + " seq_callback.set_chips(self.seq_callback)\n", + " with UDPCapture('chips', self.sock, self.nsrc, self.src0, self.max_size,\n", + " self.ntime_gulp, self.ntime_slot, sequence_callback=seq_callback,\n", + " core=self.core) as capture:\n", + " while not self.shutdown_event.is_set():\n", + " status = capture.recv()\n", + " del capture" + ] + }, + { + "cell_type": "markdown", + "id": "3048e76d", + "metadata": { + "id": "3048e76d" + }, + "source": [ + "This block implements data capture of the [CHIPS format](https://github.com/jaycedowell/bifrost/blob/disk-readers/src/formats/chips.hpp#L36) from the network. The snippet starts out by creating a socket that will be used to receive the data on using `bifrost.address.Address` and `bifrost.udp_socket.UDPSocket`. The capture block looks similar to other blocks that we have looked at but there are a few things to note.\n", + " 1. This block accepts many more keywords than the previous block. These extra keywords are used to control the packet capture and data ordering when it is copied into the ring buffer. They are:\n", + " * `nsrc` - The number of packet sources to expect data from,\n", + " * `src0` - The source ID number for the first packet socket,\n", + " * `max_size` - The maximum packet size to accept. This is usually set to 9000 to allow for jumbo packets,\n", + " * `ntime_gulp` - This controls the internal buffer size used by the packet capture. Bifrost keeps two buffers open and releases them to the output ring as data from new gulps is received.\n", + " * `ntime_slot` - The approximate number of packet sets (a packet from all `nsrc` sources) per second. This is used by Bifrost to determine the boundaries in the gulps.\n", + " 2. There is a an internal `threading.Event` instance that is used as a signal for telling the `CaptureOp` block to stop. Without the capture would run indefinitely.\n", + " 3. There is a `seq_callback` method that is called by Bifrost when the packet sequence changes. This method accepts a format-specific number of arguments and returns a JSON-packed header that sent to the ring.\n", + " 4. The `main` method implements the packet capture by calling a collection of Bifrost classes:\n", + " * First, a new `PacketCaptureCallback` instance is created and then the callback for the CHIPS format is set to `CaptureOp.seq_callback`. This redies the method for Bifrost to use it when the sequence changes.\n", + " * Next, a new `UDPCapture` instance is created for the packet format with the relevant source/data parameters. This is used as a context for this packet capture itself.\n", + " * Finally, `UDPCapture.recv` is called repeatedly to receive and process packets. This method returns an integer after a gulp has been released to the ring. This interger stores the current state of the capture.\n", + "\n", + "As mentioned before, Bifrost also works with reading packets from a file using the `bifrost.packet_capture.DiskReader` class. This works similar to `UDPCapture` but the packet format specifiers require extra information in order to read packets from disk. For example, a CHIPS capture of 132 channels is specified as \"chips\" for `UDPCapture` but as \"chips_132\" for `DiskReader`." + ] + }, + { + "cell_type": "markdown", + "id": "52efad41", + "metadata": { + "id": "52efad41" + }, + "source": [ + "## Writing Data\n", + "\n", + "Related to this capture interface is the `bifrost.packet_writer` module. This implments the reverse of the capture in that it takes data from a ring and write it to the network or disk.\n", + "\n", + "Let's look at an example of writing binary data in the [LWA TBN format](https://fornax.phys.unm.edu/lwa/trac/wiki/DP_Formats#TBNOutputInterface), a stream of 8+8-bit complex integers:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "a67846f0", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "a67846f0", + "outputId": "12ba73a5-913c-4afb-b812-04cb5f430c68" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Input:\n", + " 0 @ 0 : (-9.040182113647461+5.184663772583008j) -> (-9, 5)\n", + " 1 @ 0 : (-0.7387441396713257-1.1859489679336548j) -> (-1, -1)\n", + " 2 @ 0 : (14.541327476501465-2.5483381748199463j) -> (15, -3)\n", + " 3 @ 0 : (10.429906845092773+19.244178771972656j) -> (10, 19)\n", + " 4 @ 0 : (-1.082539439201355+6.93345832824707j) -> (-1, 7)\n", + "Output:\n", + "[(-9, 5), (-1, -1), (15, -3), (10, 19), (-1, 7)]\n" + ] + } + ], + "source": [ + "import time\n", + "import numpy\n", + "from bifrost.packet_writer import HeaderInfo, DiskWriter\n", + "\n", + "with open('output.dat', 'wb') as fh:\n", + " bfo = DiskWriter('tbn', fh, core=0)\n", + " desc = HeaderInfo()\n", + " desc.set_tuning(int(round(38e6 / 196e6 * 2**32)))\n", + " desc.set_gain(20)\n", + " \n", + " time_tag = int(time.time()*196e6)\n", + " \n", + " data = numpy.random.randn(16, 512*10)\n", + " data = data + 1j*numpy.random.randn(*data.shape)\n", + " for i in range(16):\n", + " data[i,:] *= 4\n", + " data = bifrost.ndarray(data.astype(numpy.complex64))\n", + " \n", + " qdata = bifrost.ndarray(shape=data.shape, dtype='ci8')\n", + " bifrost.quantize(data, qdata, scale=2)\n", + " print('Input:')\n", + " for i in range(5):\n", + " print(' ', i, '@', 0, ':', data[0,i]*2, '->', qdata[0,i])\n", + " \n", + " qdata = qdata.reshape(16, -1, 512)\n", + " qdata = qdata.transpose(1,0,2).copy()\n", + " \n", + " bfo.send(desc, time_tag, qdata.shape[0]*1960, 0, 1, qdata)\n", + " \n", + "import struct\n", + "print('Output:')\n", + "with open('output.dat', 'rb') as fh:\n", + " packet_header = fh.read(24)\n", + " packet_payload = fh.read(512*2)\n", + " packet_payload = struct.unpack('<1024b', packet_payload)\n", + " i, q = packet_payload[0::2], packet_payload[1::2]\n", + " print(list(zip(i,q))[:5])\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "52762b36", + "metadata": { + "id": "52762b36" + }, + "source": [ + "The flow here is:\n", + " 1. Opening a file in binary write mode and creating new `DiskWriter` and `HeaderInfo` instances. `DiskWriter` is what actually writes the formatted data to disk and `HeaderInfo` is a metadata helper used to fill in the packet headers as they are written.\n", + " 2. Setting the \"tuning\" and \"gain\" parameters for the output headers. These are values that are common to all of the packets written.\n", + " 3. Creating a time tag for the first sample and a collection of complex data that will go into the packets.\n", + " 4. Converting the complex data into the 8+8-bit integer format expected for TBN data. The `DiskWriter` instances are data type-aware.\n", + " 5. Reshaping `qdata` so that it has axes of (packet number, output index, samples per packet).\n", + " 6. Actually writing the data to disk with `DiskWriter.send`. This method takes in:\n", + " * a `HeaderInfo` instance used to population the header,\n", + " * a starting time tag value,\n", + " * a time tag increment to apply when moving to the next packet,\n", + " * an output naming starting index,\n", + " * a output naming increment to apply when moving to the next output name, and\n", + " * the data itself.\n", + "\n", + "After this we re-open the file and read in the data to verify that what is written matches what was put in. Since the data is 8+8-bit complex this is easy to do with some information about the packet structure and the `struct` module.\n", + "\n", + "To write to the network rather than a file you would:\n", + " 1. Swap the open filehandle with a `bifrost.udp_socket.UDPSocket` instance and\n", + " 2. Trade `bifrost.packet_writer.DiskWriter` for `bifrost.packet_writer.UDPTransmit`." + ] + }, + { + "cell_type": "markdown", + "id": "f8c48a43", + "metadata": { + "id": "f8c48a43" + }, + "source": [ + "## Adding a New Packet Format\n", + "\n", + "Adding a new packet format to Bifrost is a straightforward task:\n", + " 1. Add a new `.hpp` file to `bifrost/src/formats`. This file should contain:\n", + " * the header format for the packet, \n", + " * a sub-class of the C++ `PacketDecoder` class that implements a packet validator,\n", + " * a sub-class of the C++ `PacketProcessor` class that implements an unpacket to take the payload for a valid packet and place it in the correct position inside a ring buffer, and\n", + " * *optionally*, a sub-class of the C++ `PacketHeaderFiller` class that can be used when creating packets from Bifrost.\n", + " 2. Add the new format to `packet_capture.hpp`. This has three parts:\n", + " * Add a new method to the C++ class `BFpacketcapture_callback_impl` to handle the sequence change callback.\n", + " * Add new sub-class of the C++ `BFpacketcapture_impl` class that implements the format and defines how Bifrost detects changes in the packet sequence.\n", + " * Update the C++ function `BFpacketcapture_create` to expose the new packet format.\n", + " 3. Add the new format callback helper to `packet_capture.cpp`.\n", + " 4. Update `bifrost/packet_capture.h` to expose the new callback to the Python API.\n", + " 5. *Optionally*, add support for writing packets:\n", + " * Add the new format to `packet_writer.hpp` by adding a new sub-class of the C++ `BFpacketwriter_impl` class.\n", + " * Update the C++ `BFpacketwriter_create` function to expose the new packet format." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + }, + "colab": { + "name": "06_data_capture.ipynb", + "provenance": [] + }, + "accelerator": "GPU", + "gpuClass": "standard" + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/07_high_level_api.ipynb b/tutorial/07_high_level_api.ipynb new file mode 100644 index 000000000..2b383af55 --- /dev/null +++ b/tutorial/07_high_level_api.ipynb @@ -0,0 +1,459 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "diverse-space", + "metadata": { + "id": "diverse-space" + }, + "source": [ + "# High Level Python API\n", + "\n", + "\"Open\n", + "\n", + "Up until now we have been using the low level Python API that Bifrost has to show the inner workings of the framework and how to build a pipeline. However, Bifrost also has a high level Python API that makes building blocks and pipelines easier with less code. In this section we will look at this interface.\n", + "\n", + "The general idea of the high-level API is to allow a pipeline to be built out of processing blocks that are connected together like Lego. For example, here is a pipeline that reads from a sigproc file, performs a fast dispersion measure transform, and then writes out the data to disk:\n", + "\n", + "```python\n", + "import bifrost as bf\n", + "import sys\n", + "\n", + "filenames = sys.argv[1:]\n", + "\n", + "print(\"Building pipeline\")\n", + "data = bf.blocks.read_sigproc(filenames, gulp_nframe=128)\n", + "data = bf.blocks.copy(data, 'cuda')\n", + "data = bf.blocks.transpose(data, ['pol', 'freq', 'time'])\n", + "data = bf.blocks.fdmt(data, max_dm=100.)\n", + "data = bf.blocks.copy(data, 'cuda_host')\n", + "bf.blocks.write_sigproc(data)\n", + "\n", + "print(\"Running pipeline\")\n", + "bf.get_default_pipeline().run()\n", + "print(\"All done\")\n", + "```\n", + "\n", + "Here we are continually passing the block's output, `data`, to the next block in the pipeline. At runtime, the blocks are connected together (as a directed graph) with ring buffers in between.\n" + ] + }, + { + "cell_type": "code", + "source": [ + "%%capture install_log\n", + "# Import bifrost, but attempt to auto-install if needed (and we're running on\n", + "# Colab). If something goes wrong, evaluate install_log.show() in a new block\n", + "# to retrieve the details.\n", + "try:\n", + " import bifrost\n", + "except ModuleNotFoundError as exn:\n", + " try:\n", + " import google.colab\n", + " except ModuleNotFoundError:\n", + " raise exn\n", + " !sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential\n", + " !pip install -q contextlib2 pint simplejson scipy git+https://github.com/ctypesgen/ctypesgen.git\n", + " ![ -d ~/bifrost/.git ] || git clone https://github.com/ledatelescope/bifrost ~/bifrost\n", + " !(cd ~/bifrost && ./configure --disable-cuda && make -j all && sudo make install)\n", + " import bifrost" + ], + "metadata": { + "id": "kIQelikFM5mZ" + }, + "id": "kIQelikFM5mZ", + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "\n", + "### Creating a transform block\n", + "\n", + "Many common processing operations have bifrost blocks, but it likely that you will need to make a custom block at some stage. To see how, let's start by revisiting the `CopyOp` block from the pipelines section:" + ], + "metadata": { + "id": "obSTqcFKM4WV" + }, + "id": "obSTqcFKM4WV" + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "black-cruise", + "metadata": { + "id": "black-cruise" + }, + "outputs": [], + "source": [ + "class CopyOp(object):\n", + " def __init__(self, iring, oring, ntime_gulp=250, guarantee=True, core=-1):\n", + " self.iring = iring\n", + " self.oring = oring\n", + " self.ntime_gulp = ntime_gulp\n", + " self.guarantee = guarantee\n", + " self.core = core\n", + " \n", + " def main(self):\n", + " with self.oring.begin_writing() as oring:\n", + " for iseq in self.iring.read(guarantee=self.guarantee):\n", + " ihdr = json.loads(iseq.header.tostring())\n", + " \n", + " print(\"Copy: Start of new sequence:\", str(ihdr))\n", + " \n", + " time_tag = ihdr['time_tag']\n", + " navg = ihdr['navg']\n", + " nbeam = ihdr['nbeam']\n", + " chan0 = ihdr['chan0']\n", + " nchan = ihdr['nchan']\n", + " chan_bw = ihdr['bw'] / nchan\n", + " npol = ihdr['npol']\n", + " pols = ihdr['pols']\n", + " pols = pols.replace('CR', 'XY_real')\n", + " pols = pols.replace('CI', 'XY_imag')\n", + "\n", + " igulp_size = self.ntime_gulp*nbeam*nchan*npol*4 # float32\n", + " ishape = (self.ntime_gulp,nbeam,nchan,npol)\n", + " self.iring.resize(igulp_size, igulp_size*5)\n", + " \n", + " ogulp_size = igulp_size\n", + " oshape = ishape\n", + " self.oring.resize(ogulp_size)\n", + " \n", + " ohdr = ihdr.copy()\n", + " ohdr_str = json.dumps(ohdr)\n", + " \n", + " iseq_spans = iseq.read(igulp_size)\n", + " with oring.begin_sequence(time_tag=time_tag, header=ohdr_str) as oseq:\n", + " for ispan in iseq_spans:\n", + " if ispan.size < igulp_size:\n", + " continue # Ignore final gulp\n", + " \n", + " with oseq.reserve(ogulp_size) as ospan:\n", + " idata = ispan.data_view(numpy.float32)\n", + " odata = ospan.data_view(numpy.float32) \n", + " odata[...] = idata" + ] + }, + { + "cell_type": "markdown", + "id": "fiscal-coverage", + "metadata": { + "id": "fiscal-coverage" + }, + "source": [ + "There is a lot of setup in here and iteration control that is common across many of the blocks that we have looked at. In the high level API much of this can be abstracted away using the classes defined in `bifrost.pipelines`:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "intelligent-retailer", + "metadata": { + "id": "intelligent-retailer" + }, + "outputs": [], + "source": [ + "import copy\n", + "\n", + "from bifrost import pipeline\n", + "\n", + "class NewCopyOp(pipeline.TransformBlock):\n", + " def __init__(self, iring, *args, **kwargs):\n", + " super(NewCopyOp, self).__init__(iring, *args, **kwargs)\n", + " \n", + " def on_sequence(self, iseq):\n", + " ihdr = iseq.header\n", + " print(\"Copy: Start of new sequence:\", str(ihdr))\n", + " \n", + " ohdr = copy.deepcopy(iseq.header)\n", + " return ohdr\n", + "\n", + " def on_data(self, ispan, ospan):\n", + " in_nframe = ispan.nframe\n", + " out_nframe = in_nframe\n", + "\n", + " idata = ispan.data\n", + " odata = ospan.data\n", + "\n", + " odata[...] = idata\n", + " return out_nframe" + ] + }, + { + "cell_type": "markdown", + "id": "unique-basement", + "metadata": { + "id": "unique-basement" + }, + "source": [ + "That is much more compact. The key things in this new class are:\n", + " 1. the `on_sequence` method is called whenever a new sequence starts and is used to update the header for the output ring buffer and\n", + " 2. the `on_data` method is called for each span/gulp that is processed.\n", + "\n", + "Put another way, the `on_sequence` happens when there is new *metadata*, and `on_data` happens whenever there is new *data* to process. For example, `on_sequence` may be called when reading a new file, or starting an observation.\n", + " \n" + ] + }, + { + "cell_type": "markdown", + "id": "communist-worse", + "metadata": { + "id": "communist-worse" + }, + "source": [ + "### Creating a source block\n", + "\n", + " Similarly, we can translate the `GeneratorOp` and `WriterOp` blocks as well using sub-classes of `bifrost.pipeline.SourceBlock` and `bifrost.pipeline.SinkBlock`, respectively:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "grand-central", + "metadata": { + "id": "grand-central" + }, + "outputs": [], + "source": [ + "import os\n", + "import time\n", + "import numpy\n", + "\n", + "class NewGeneratorOp(pipeline.SourceBlock):\n", + " def __init__(self, ntime_gulp, *args, **kwargs):\n", + " super(NewGeneratorOp, self).__init__(['generator',], 1,\n", + " *args, **kwargs)\n", + " \n", + " self.ntime_gulp = ntime_gulp\n", + " self.ngulp_done = 0\n", + " self.ngulp_max = 10\n", + " \n", + " self.navg = 24\n", + " tint = self.navg / 25e3\n", + " self.tgulp = tint * self.ntime_gulp\n", + " self.nbeam = 1\n", + " self.chan0 = 1234\n", + " self.nchan = 16*184\n", + " self.npol = 4\n", + " \n", + " def create_reader(self, name):\n", + " self.ngulp_done = 0\n", + " \n", + " class Random(object):\n", + " def __init__(self, name):\n", + " self.name = name\n", + " def __enter__(self):\n", + " return self\n", + " def __exit__(self, type, value, tb):\n", + " return True\n", + " def read(self, *args):\n", + " return numpy.random.randn(*args)\n", + " \n", + " return Random(name)\n", + " \n", + " def on_sequence(self, reader, name):\n", + " ohdr = {'time_tag': int(int(time.time())*196e6),\n", + " 'seq0': 0, \n", + " 'chan0': self.chan0,\n", + " 'cfreq0': self.chan0*25e3,\n", + " 'bw': self.nchan*25e3,\n", + " 'navg': self.navg,\n", + " 'nbeam': self.nbeam,\n", + " 'nchan': self.nchan,\n", + " 'npol': self.npol,\n", + " 'pols': 'XX,YY,CR,CI',\n", + " }\n", + " ohdr['_tensor'] = {'dtype': 'f32',\n", + " 'shape': [-1,\n", + " self.ntime_gulp,\n", + " self.nbeam,\n", + " self.nchan,\n", + " self.npol]\n", + " }\n", + " return [ohdr,]\n", + " \n", + " def on_data(self, reader, ospans):\n", + " indata = reader.read(self.ntime_gulp, self.nbeam, self.nchan, self.npol)\n", + " time.sleep(self.tgulp)\n", + "\n", + " if indata.shape[0] == self.ntime_gulp \\\n", + " and self.ngulp_done < self.ngulp_max:\n", + " ospans[0].data[...] = indata\n", + " self.ngulp_done += 1\n", + " return [1]\n", + " else:\n", + " return [0] " + ] + }, + { + "cell_type": "markdown", + "id": "essential-burst", + "metadata": { + "id": "essential-burst" + }, + "source": [ + "For the `bifrost.pipeline.SourceBlock` we need have slightly different requirements on `on_sequence` and `on_data`. Plus, we also need to define a `create_reader` method that returns a context manager (a class with `__enter__` and `__exit__` methods). \n", + "\n", + "For `on_sequence` we need to accept two arguments: a context manager created by `create_reader` and an identifying name (although it is not used here). \n", + "\n", + "For `on_data` we also have two arguments now, the context manager and a list of output spans. In here we need to grab the data from `reader` and put it into the appropriate part of the output spans.\n", + "\n", + "### The all-important bifrost `_tensor` dictionary\n", + "\n", + "We also see in `on_sequence` here that the header dictionary has a new required `_tensor` key. This key is the key to automatically chaining blocks together into a pipeline since it defines the data type and dimensionality for the spans/gulps. At a minimum, the `_tensor` must define the data dtype and shape:\n", + "\n", + "```python\n", + " '_tensor': {\n", + " 'dtype': self.dtype,\n", + " 'shape': [-1, self.gulp_size],\n", + " },\n", + "```\n", + "\n", + "The first index of shape is -1, to indicate that this is a single gulp from the data stream. \n", + "\n", + "However, most block require three additional keywords: \n", + "* `labels`, which give human-friendly names to each axis (e.g. 'time' or 'frequency').\n", + "* `scales`, which defines the start value and step size for each axis (e.g. `[1420, 0.1]` sets start value 1420, step size 0.1).\n", + "* `units`, which defines the units for each axis (e.g. 's' or 'MHz'). These are parsed using [Pint](https://pint.readthedocs.io/en/stable/), and can be used for consistency checking. For example, the `bf.views.merge_axes` view won't allow axes to merge if they have different units, say 'MHz' and 'Jy'. If you attempted to merge axes with 'MHz' and 'kHz' units, this would be allowed, and the corresponding `scales` are updated consistently.\n", + "\n", + "Here is another example `_tensor` with all keywords:\n", + "\n", + "```python\n", + " t0 = 1620192408.005579 # unix timestamp from when writing this tutorial\n", + " dt = 0.1 # 0.1 second step size\n", + " '_tensor': {\n", + " 'dtype': 'cf32'\n", + " 'shape': [-1, 1024, 4],\n", + " 'labels': ['time', 'frequency', 'pol'],\n", + " 'units': ['s', 'MHz', ''],\n", + " 'scales': [[t0, dt], [1420, 0.1], [None, None]]\n", + " }\n", + "```\n", + "\n", + "A transform block reads the tensor metadata, and must output a copy of the tensor with any required changes to shape/scale/units etc. \n", + "\n", + "### Creating a sink block\n", + "\n", + "We can also translate the original `WriterOp`:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "hispanic-toddler", + "metadata": { + "id": "hispanic-toddler" + }, + "outputs": [], + "source": [ + "class NewWriterOp(pipeline.SinkBlock):\n", + " def __init__(self, iring, *args, **kwargs):\n", + " super(NewWriterOp, self).__init__(iring, *args, **kwargs)\n", + " \n", + " self.time_tag = None\n", + " self.navg = 0\n", + " self.nbeam = 0\n", + " self.nchan = 0\n", + " self.npol = 0\n", + " \n", + " def on_sequence(self, iseq):\n", + " ihdr = iseq.header\n", + " print(\"Writer: Start of new sequence:\", str(ihdr))\n", + " \n", + " self.time_tag = iseq.time_tag\n", + " self.navg = ihdr['navg']\n", + " self.nbeam = ihdr['nbeam']\n", + " self.nchan = ihdr['nchan']\n", + " self.npol = ihdr['npol']\n", + "\n", + " def on_data(self, ispan):\n", + " idata = ispan.data.view(numpy.float32)\n", + " idata = idata.reshape(-1, self.nbeam, self.nchan, self.npol)\n", + " \n", + " with open(f\"{self.time_tag}.dat\", 'wb') as fh:\n", + " fh.write(idata.tobytes())\n", + " print(' ', fh.name, '@', os.path.getsize(fh.name))\n", + " self.time_tag += self.navg * idata.shape[0] * (int(196e6) // int(25e3))" + ] + }, + { + "cell_type": "markdown", + "id": "arbitrary-dynamics", + "metadata": { + "id": "arbitrary-dynamics" + }, + "source": [ + "Since this is a data sink we only have one argument for `on_data` which gives the block the current data span/gulp.\n", + "\n", + "We then can put these new blocks all together and launch them under Bifrost's default pipeline with:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "objective-principal", + "metadata": { + "id": "objective-principal", + "outputId": "b4c6067b-2b11-49c2-c5ab-490d6bc01a78", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Copy: Start of new sequence: {'time_tag': 324661240792000000, 'seq0': 0, 'chan0': 1234, 'cfreq0': 30850000.0, 'bw': 73600000.0, 'navg': 24, 'nbeam': 1, 'nchan': 2944, 'npol': 4, 'pols': 'XX,YY,CR,CI', '_tensor': {'dtype': 'f32', 'shape': [-1, 250, 1, 2944, 4]}, 'name': 'unnamed-sequence-0', 'gulp_nframe': 1}\n", + "Writer: Start of new sequence: {'time_tag': 324661240792000000, 'seq0': 0, 'chan0': 1234, 'cfreq0': 30850000.0, 'bw': 73600000.0, 'navg': 24, 'nbeam': 1, 'nchan': 2944, 'npol': 4, 'pols': 'XX,YY,CR,CI', '_tensor': {'dtype': 'f32', 'shape': [-1, 250, 1, 2944, 4]}, 'name': 'unnamed-sequence-0', 'gulp_nframe': 1}\n", + " 324661240792000000.dat @ 11776000\n", + " 324661240839040000.dat @ 11776000\n", + " 324661240886080000.dat @ 11776000\n", + " 324661240933120000.dat @ 11776000\n", + " 324661240980160000.dat @ 11776000\n", + " 324661241027200000.dat @ 11776000\n", + " 324661241074240000.dat @ 11776000\n", + " 324661241121280000.dat @ 11776000\n", + " 324661241168320000.dat @ 11776000\n", + " 324661241215360000.dat @ 11776000\n" + ] + } + ], + "source": [ + "b_gen = NewGeneratorOp(250)\n", + "b_cpy = NewCopyOp(b_gen)\n", + "b_out = NewWriterOp(b_cpy)\n", + "\n", + "p = pipeline.get_default_pipeline()\n", + "p.run()\n", + "del p" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.6" + }, + "colab": { + "name": "07_high_level_api.ipynb", + "provenance": [] + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/tutorial/08_extending_bifrost.ipynb b/tutorial/08_extending_bifrost.ipynb new file mode 100644 index 000000000..9490079f1 --- /dev/null +++ b/tutorial/08_extending_bifrost.ipynb @@ -0,0 +1,56 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "introductory-custody", + "metadata": {}, + "source": [ + "# Extending Bifrost\n", + "\n", + "With the overview of Bifrost and how to build pipelines within the framework out of the way we can turn our attention to extending the core functionality of Bifrost. There are currently three options:\n", + " 1. A pure Python implementation within the low or high level APIs,\n", + " 2. Using just-in-time compilation via numba or bifrost.map for the implemenations, or\n", + " 3. Adding a new C/C++/CUDA module, along with the associated Python wrapper, to Bifrost.\n", + "\n", + "The first two options are straight forward and have been demonstrated earlier in this tutorial. The third option is more involved and this section provides a brief \"how to\".\n", + "\n", + " 1. Create a new source file in `src/` that defines that functions or classes you want. In general these functions should take in C/C++ pointers to `BFarray`s and return `BFstatus` code (see `src/bifrost/common.h`).\n", + " 2. Create a C-compatible header file for your functions in `src/bifrost/`. This will be used to create the Python wrappers via `ctypesgen` that will go into `bifrost.libbifrost_generated`.\n", + " 3. Update `src/Makefile` and add the object file associated with the new source files to `LIBBIFROST_OBJS` so that they get built with `make`.\n", + " 4. Build the necessary low level Python API wrappers needed in `python/bifrost/`.\n", + " 5. Optionally, build the necessary high level Python API wrapper needed in `python/bifrost/blocks/`.\n", + " \n", + "We are also working on a plugin system for Bifrost that should make this process easier by eliminating steps 3 and 4. To get a preview of this system see: https://github.com/ledatelescope/bifrost/tree/plugin-wrapper/plugins" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "great-mercury", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tutorial/LICENSE b/tutorial/LICENSE new file mode 100644 index 000000000..19db1efad --- /dev/null +++ b/tutorial/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, LEDA Collaboration +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tutorial/README.md b/tutorial/README.md new file mode 100644 index 000000000..829f1fa7c --- /dev/null +++ b/tutorial/README.md @@ -0,0 +1,31 @@ +# The Bifrost Tutorial + +A collection of examples that show how to use various features in the [Bifrost framework](https://github.com/ledatelescope/bifrost/). Before beginning this tutorial it would be a good idea to familiarize yourself with the framework and its concepts: + + * Bifrost is described in [Cranmer et al.](https://arxiv.org/abs/1708.00720) + * Documentation for the Python APIs can be found [here](http://ledatelescope.github.io/bifrost/) + * There is an [overview talk of Bifrost](https://www.youtube.com/watch?v=DXH89rOVVzg) from the 2019 CASPER workshop. + * There is a [walk through of this tutorial](https://youtu.be/ktk2dkUssAA?t=20170) from the 2021 CASPER workshop. + +You should be able to run these notebooks in any Jupyter environment that has Bifrost installed — just open the `.ipynb` files in this directory. To try them without installing Bifrost or configuring Jupyter locally, you can open them in Google Colab (free, cloud) or use Docker (local, requires GPU hardware but dependencies are bundled). + +## Google Colab + +This is the simplest way to try the tutorial, without needing to install or configure anything. It also does not require a local GPU: Google currently provides free access to one GPU-enabled runtime (for foreground computation only). + +Visit each `.ipynb` file in this directory on GitHub, where you can read the text, code, and see static output. To allow interaction, use the “Open in Colab” button at the top. Then use control-enter to run each selected code block; the first one should install Bifrost on your runtime instance. (It can take a short while, but a green arrow should march through the steps. If you switch away, just remember to return before the instance times out!) + +Please [report any issues](https://github.com/ledatelescope/bifrost/issues) with opening, installing, or running the tutorial notebooks on Colab. + +## Docker Image + +We provide a Docker image with Bifrost, CUDA, Jupyter, and the tutorial already installed if you want a quicker path to trying it out. Simply run: + + ``` + docker pull lwaproject/bifrost_tutorial + docker run -p 8888:8888 --runtime=nvidia lwaproject/bifrost_tutorial + ``` + + This will start the Jupyter server on port 8888 which you can connect to with a browser running on the + host. *Note that this uses Nvidia runtime for Docker to allow access to the host's GPU for the GPU-enabled + portions of the tutorial.* diff --git a/tutorial/docker/Dockerfile b/tutorial/docker/Dockerfile new file mode 100644 index 000000000..e5f876ecc --- /dev/null +++ b/tutorial/docker/Dockerfile @@ -0,0 +1,193 @@ +ARG BASE_CONTAINER=nvidia/cuda:10.1-devel-ubuntu18.04 +FROM $BASE_CONTAINER + +LABEL maintainer="Jayce Dowell " +ARG LSL_USER="lwa" +ARG LSL_UID="1000" +ARG LSL_GID="100" + +# Build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG VCS_REF +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Bifrost - Jupyter image" \ + org.label-schema.description="Image with CUDA, Bifrost, LSL, and a useful Jupyter stack" \ + org.label-schema.url="https://github.com/ledatelescope/bifrost" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/ledatelescope/bifrost_tutorial" \ + org.label-schema.schema-version="1.0" + +USER root + +# Install all OS dependencies for fully functional notebook server +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && \ + apt-get install -yq --no-install-recommends \ + build-essential \ + bzip2 \ + ca-certificates \ + curl \ + doxygen \ + emacs-nox \ + exuberant-ctags \ + fonts-liberation \ + git \ + inkscape \ + jed \ + libboost-python-dev \ + libcfitsio-dev \ + libfftw3-dev \ + libgdbm-dev \ + libhdf5-dev \ + libhwloc-dev \ + libnuma-dev \ + libsm6 \ + libxext-dev \ + libxrender1 \ + locales \ + lmodern \ + nano \ + netcat \ + pkg-config \ + python3-dev \ + python3-pip \ + python3-setuptools \ + run-one \ + software-properties-common \ + sudo \ + swig \ + tcsh \ + vim \ + wget \ + # ---- nbconvert dependencies ---- + texlive-xetex \ + texlive-fonts-recommended \ + texlive-generic-recommended \ + # Optional dependency + texlive-fonts-extra \ + # ---- + tzdata \ + unzip && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ + locale-gen + +# Configure the environment +ENV SHELL=/bin/bash \ + LSL_USER=$LSL_USER \ + LSL_UID=$LSL_UID \ + LSL_GID=$LSL_GID \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 +ENV HOME=/home/$LSL_USER +RUN python3 -m pip install --upgrade virtualenv + +# Copy a script that we will use to correct permissions after running certain commands +COPY fix-permissions /usr/local/bin/fix-permissions +RUN chmod a+rx /usr/local/bin/fix-permissions + +# Enable prompt color in the skeleton .bashrc before creating the default LSL_USER +RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashrc + +# Create LSL_USER with name lwa user with UID=1000 and in the 'users' group +# and make sure these dirs are writable by the `users` group. +RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ + sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \ + sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \ + useradd -m -s /bin/bash -N -u $LSL_UID $LSL_USER && \ + chmod g+w /etc/passwd && \ + fix-permissions $HOME + +USER $LSL_UID +WORKDIR $HOME + +# Activate the environment +ENV VIRTUAL_ENV=$HOME/venv +RUN python3 -m virtualenv -p python3 $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +# Setup LSL +RUN pip install \ + setuptools \ + numpy \ + matplotlib \ + scipy \ + h5py \ + pyephem==3.7.6.0 && \ + pip install aipy && \ + pip install lsl + +# Setup Bifrost +## Dependencies + numba +RUN pip install \ + contextlib2 \ + graphviz \ + numba \ + pint \ + simplejson \ + ctypesgen==1.0.2 +## Bifrost +RUN git clone https://github.com/ledatelescope/bifrost.git && \ + cd /home/$LSL_USER/bifrost +RUN cd /home/$LSL_USER/bifrost && \ + ./configure --with-gpu-archs="35 50 61 75" && \ + make -j all && \ + make doc && \ + cd /home/$LSL_USER && \ + ln -s /home/$LSL_USER/bifrost/tutorial /home/$LSL_USER/bifrost_tutorial + +# Back to root +USER root + +RUN cd /home/$LSL_USER/bifrost && \ + make install + +# Setup work directory for backward-compatibility +RUN mkdir /home/$LSL_USER/work && \ + fix-permissions /home/$LSL_USER + +# Install Tini +RUN pip install tini && \ + fix-permissions /home/$LSL_USER + +# Setup Jupyter +RUN pip install \ + jupyterlab \ + jupyterhub \ + jupyter_client \ + nbformat \ + nbconvert && \ + jupyter notebook --generate-config && \ + rm -rf /home/$LSL_USER/.cache/yarn && \ + fix-permissions /home/$LSL_USER + +EXPOSE 8888 +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/lwa/venv/lib" + +# Configure container startup +# Add Tini +ENV TINI_VERSION v0.18.0 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini +ENTRYPOINT ["/tini", "--"] +CMD ["start-notebook.sh"] + +# Copy local files as late as possible to avoid cache busting +COPY start.sh start-notebook.sh start-singleuser.sh /usr/local/bin/ +RUN chmod a+rx /usr/local/bin/start*.sh +COPY jupyter_notebook_config.py /etc/jupyter/ + +# Fix permissions on /etc/jupyter as root +USER root +RUN fix-permissions /etc/jupyter/ + +# Import matplotlib the first time to build the font cache. +ENV XDG_CACHE_HOME /home/$LSL_USER/.cache/ +RUN MPLBACKEND=Agg python -c "import matplotlib.pyplot" && \ + fix-permissions /home/$LSL_USER + +# Switch back to lwa to avoid accidental container runs as root +USER $LSL_UID diff --git a/tutorial/docker/fix-permissions b/tutorial/docker/fix-permissions new file mode 100644 index 000000000..2358cc917 --- /dev/null +++ b/tutorial/docker/fix-permissions @@ -0,0 +1,35 @@ +#!/bin/bash +# set permissions on a directory +# after any installation, if a directory needs to be (human) user-writable, +# run this script on it. +# It will make everything in the directory owned by the group $LSL_GID +# and writable by that group. +# Deployments that want to set a specific user id can preserve permissions +# by adding the `--group-add users` line to `docker run`. + +# uses find to avoid touching files that already have the right permissions, +# which would cause massive image explosion + +# right permissions are: +# group=$LSL_GID +# AND permissions include group rwX (directory-execute) +# AND directories have setuid,setgid bits set + +set -e + +for d in "$@"; do + find "$d" \ + ! \( \ + -group $LSL_GID \ + -a -perm -g+rwX \ + \) \ + -exec chgrp $LSL_GID {} \; \ + -exec chmod g+rwX {} \; + # setuid,setgid *on directories only* + find "$d" \ + \( \ + -type d \ + -a ! -perm -6000 \ + \) \ + -exec chmod +6000 {} \; +done diff --git a/tutorial/docker/jupyter_notebook_config.py b/tutorial/docker/jupyter_notebook_config.py new file mode 100644 index 000000000..92fa67741 --- /dev/null +++ b/tutorial/docker/jupyter_notebook_config.py @@ -0,0 +1,55 @@ +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +from jupyter_core.paths import jupyter_data_dir +import subprocess +import os +import errno +import stat + +c = get_config() +c.NotebookApp.ip = '0.0.0.0' +c.NotebookApp.port = 8888 +c.NotebookApp.open_browser = False + +# https://github.com/jupyter/notebook/issues/3130 +c.FileContentsManager.delete_to_trash = False + +# Generate a self-signed certificate +if 'GEN_CERT' in os.environ: + dir_name = jupyter_data_dir() + pem_file = os.path.join(dir_name, 'notebook.pem') + try: + os.makedirs(dir_name) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(dir_name): + pass + else: + raise + + # Generate an openssl.cnf file to set the distinguished name + cnf_file = os.path.join(os.getenv('CONDA_DIR', '/usr/lib'), 'ssl', 'openssl.cnf') + if not os.path.isfile(cnf_file): + with open(cnf_file, 'w') as fh: + fh.write('''\ +[req] +distinguished_name = req_distinguished_name +[req_distinguished_name] +''') + + # Generate a certificate if one doesn't exist on disk + subprocess.check_call(['openssl', 'req', '-new', + '-newkey', 'rsa:2048', + '-days', '365', + '-nodes', '-x509', + '-subj', '/C=XX/ST=XX/L=XX/O=generated/CN=generated', + '-keyout', pem_file, + '-out', pem_file]) + # Restrict access to the file + os.chmod(pem_file, stat.S_IRUSR | stat.S_IWUSR) + c.NotebookApp.certfile = pem_file + +# Change default umask for all subprocesses of the notebook server if set in +# the environment +if 'LSL_UMASK' in os.environ: + os.umask(int(os.environ['LSL_UMASK'], 8)) \ No newline at end of file diff --git a/tutorial/docker/start-notebook.sh b/tutorial/docker/start-notebook.sh new file mode 100644 index 000000000..03953ded4 --- /dev/null +++ b/tutorial/docker/start-notebook.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +set -e + +wrapper="" +if [[ "${RESTARTABLE}" == "yes" ]]; then + wrapper="run-one-constantly" +fi + +# Update the tutorial +d=`pwd` +cd /home/lwa/bifrost_tutorial +git pull +cd ${d} + +if [[ ! -z "${JUPYTERHUB_API_TOKEN}" ]]; then + # launched by JupyterHub, use single-user entrypoint + exec /usr/local/bin/start-singleuser.sh "$@" +elif [[ ! -z "${JUPYTER_ENABLE_LAB}" ]]; then + . /usr/local/bin/start.sh $wrapper jupyter lab "$@" +else + . /usr/local/bin/start.sh $wrapper jupyter notebook "$@" +fi diff --git a/tutorial/docker/start-singleuser.sh b/tutorial/docker/start-singleuser.sh new file mode 100644 index 000000000..8ddce2d82 --- /dev/null +++ b/tutorial/docker/start-singleuser.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +set -e + +# set default ip to 0.0.0.0 +if [[ "$NOTEBOOK_ARGS $@" != *"--ip="* ]]; then + NOTEBOOK_ARGS="--ip=0.0.0.0 $NOTEBOOK_ARGS" +fi + +# handle some deprecated environment variables +# from DockerSpawner < 0.8. +# These won't be passed from DockerSpawner 0.9, +# so avoid specifying --arg=empty-string +if [ ! -z "$NOTEBOOK_DIR" ]; then + NOTEBOOK_ARGS="--notebook-dir='$NOTEBOOK_DIR' $NOTEBOOK_ARGS" +fi +if [ ! -z "$JPY_PORT" ]; then + NOTEBOOK_ARGS="--port=$JPY_PORT $NOTEBOOK_ARGS" +fi +if [ ! -z "$JPY_USER" ]; then + NOTEBOOK_ARGS="--user=$JPY_USER $NOTEBOOK_ARGS" +fi +if [ ! -z "$JPY_COOKIE_NAME" ]; then + NOTEBOOK_ARGS="--cookie-name=$JPY_COOKIE_NAME $NOTEBOOK_ARGS" +fi +if [ ! -z "$JPY_BASE_URL" ]; then + NOTEBOOK_ARGS="--base-url=$JPY_BASE_URL $NOTEBOOK_ARGS" +fi +if [ ! -z "$JPY_HUB_PREFIX" ]; then + NOTEBOOK_ARGS="--hub-prefix=$JPY_HUB_PREFIX $NOTEBOOK_ARGS" +fi +if [ ! -z "$JPY_HUB_API_URL" ]; then + NOTEBOOK_ARGS="--hub-api-url=$JPY_HUB_API_URL $NOTEBOOK_ARGS" +fi +NOTEBOOK_BIN="jupyterhub-singleuser" + +. /usr/local/bin/start.sh $NOTEBOOK_BIN $NOTEBOOK_ARGS "$@" diff --git a/tutorial/docker/start.sh b/tutorial/docker/start.sh new file mode 100644 index 000000000..5732bf7b0 --- /dev/null +++ b/tutorial/docker/start.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +set -e + +# Exec the specified command or fall back on bash +if [ $# -eq 0 ]; then + cmd=( "bash" ) +else + cmd=( "$@" ) +fi + +run-hooks () { + # Source scripts or run executable files in a directory + if [[ ! -d "$1" ]] ; then + return + fi + echo "$0: running hooks in $1" + for f in "$1/"*; do + case "$f" in + *.sh) + echo "$0: running $f" + source "$f" + ;; + *) + if [[ -x "$f" ]] ; then + echo "$0: running $f" + "$f" + else + echo "$0: ignoring $f" + fi + ;; + esac + done + echo "$0: done running hooks in $1" +} + +run-hooks /usr/local/bin/start-notebook.d + +# Handle special flags if we're root +if [ $(id -u) == 0 ] ; then + + # Only attempt to change the lwa username if it exists + if id lwa &> /dev/null ; then + echo "Set username to: $LSL_USER" + usermod -d /home/$LSL_USER -l $LSL_USER lwa + fi + + # Handle case where provisioned storage does not have the correct permissions by default + # Ex: default NFS/EFS (no auto-uid/gid) + if [[ "$CHOWN_HOME" == "1" || "$CHOWN_HOME" == 'yes' ]]; then + echo "Changing ownership of /home/$LSL_USER to $LSL_UID:$LSL_GID with options '${CHOWN_HOME_OPTS}'" + chown $CHOWN_HOME_OPTS $LSL_UID:$LSL_GID /home/$LSL_USER + fi + if [ ! -z "$CHOWN_EXTRA" ]; then + for extra_dir in $(echo $CHOWN_EXTRA | tr ',' ' '); do + echo "Changing ownership of ${extra_dir} to $LSL_UID:$LSL_GID with options '${CHOWN_EXTRA_OPTS}'" + chown $CHOWN_EXTRA_OPTS $LSL_UID:$LSL_GID $extra_dir + done + fi + + # handle home and working directory if the username changed + if [[ "$LSL_USER" != "lwa" ]]; then + # changing username, make sure homedir exists + # (it could be mounted, and we shouldn't create it if it already exists) + if [[ ! -e "/home/$LSL_USER" ]]; then + echo "Relocating home dir to /home/$LSL_USER" + mv /home/lwa "/home/$LSL_USER" || ln -s /home/lwa "/home/$LSL_USER" + fi + # if workdir is in /home/lwa, cd to /home/$LSL_USER + if [[ "$PWD/" == "/home/lwa/"* ]]; then + newcwd="/home/$LSL_USER/${PWD:13}" + echo "Setting CWD to $newcwd" + cd "$newcwd" + fi + fi + + # Change UID:GID of LSL_USER to LSL_UID:LSL_GID if it does not match + if [ "$LSL_UID" != $(id -u $LSL_USER) ] || [ "$LSL_GID" != $(id -g $LSL_USER) ]; then + echo "Set user $LSL_USER UID:GID to: $LSL_UID:$LSL_GID" + if [ "$LSL_GID" != $(id -g $LSL_USER) ]; then + groupadd -g $LSL_GID -o ${LSL_GROUP:-${LSL_USER}} + fi + userdel $LSL_USER + useradd --home /home/$LSL_USER -u $LSL_UID -g $LSL_GID -G 100 -l $LSL_USER + fi + + # Enable sudo if requested + if [[ "$GRANT_SUDO" == "1" || "$GRANT_SUDO" == 'yes' ]]; then + echo "Granting $LSL_USER sudo access and appending $CONDA_DIR/bin to sudo PATH" + echo "$LSL_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook + fi + + # Add $CONDA_DIR/bin to sudo secure_path + sed -r "s#Defaults\s+secure_path\s*=\s*\"?([^\"]+)\"?#Defaults secure_path=\"\1:$CONDA_DIR/bin\"#" /etc/sudoers | grep secure_path > /etc/sudoers.d/path + + # Exec the command as LSL_USER with the PATH and the rest of + # the environment preserved + run-hooks /usr/local/bin/before-notebook.d + echo "Executing the command: ${cmd[@]}" + exec sudo -E -H -u $LSL_USER PATH=$PATH XDG_CACHE_HOME=/home/$LSL_USER/.cache PYTHONPATH=${PYTHONPATH:-} "${cmd[@]}" +else + if [[ "$LSL_UID" == "$(id -u lwa)" && "$LSL_GID" == "$(id -g lwa)" ]]; then + # User is not attempting to override user/group via environment + # variables, but they could still have overridden the uid/gid that + # container runs as. Check that the user has an entry in the passwd + # file and if not add an entry. + STATUS=0 && whoami &> /dev/null || STATUS=$? && true + if [[ "$STATUS" != "0" ]]; then + if [[ -w /etc/passwd ]]; then + echo "Adding passwd file entry for $(id -u)" + cat /etc/passwd | sed -e "s/^lwa:/nayvoj:/" > /tmp/passwd + echo "lwa:x:$(id -u):$(id -g):,,,:/home/lwa:/bin/bash" >> /tmp/passwd + cat /tmp/passwd > /etc/passwd + rm /tmp/passwd + else + echo 'Container must be run with group "root" to update passwd file' + fi + fi + + # Warn if the user isn't going to be able to write files to $HOME. + if [[ ! -w /home/lwa ]]; then + echo 'Container must be run with group "users" to update files' + fi + else + # Warn if looks like user want to override uid/gid but hasn't + # run the container as root. + if [[ ! -z "$LSL_UID" && "$LSL_UID" != "$(id -u)" ]]; then + echo 'Container must be run as root to set $LSL_UID' + fi + if [[ ! -z "$LSL_GID" && "$LSL_GID" != "$(id -g)" ]]; then + echo 'Container must be run as root to set $LSL_GID' + fi + fi + + # Warn if looks like user want to run in sudo mode but hasn't run + # the container as root. + if [[ "$GRANT_SUDO" == "1" || "$GRANT_SUDO" == 'yes' ]]; then + echo 'Container must be run as root to grant sudo permissions' + fi + + # Execute the command + run-hooks /usr/local/bin/before-notebook.d + echo "Executing the command: ${cmd[@]}" + exec "${cmd[@]}" +fi diff --git a/user.mk b/user.mk deleted file mode 100644 index 49cc2a199..000000000 --- a/user.mk +++ /dev/null @@ -1,32 +0,0 @@ -CXX ?= g++ -NVCC ?= nvcc -LINKER ?= g++ -CPPFLAGS ?= -CXXFLAGS ?= -O3 -Wall -pedantic -NVCCFLAGS ?= -O3 -Xcompiler "-Wall" #-Xptxas -v -LDFLAGS ?= -DOXYGEN ?= doxygen -PYBUILDFLAGS ?= -PYINSTALLFLAGS ?= - -#GPU_ARCHS ?= 30 32 35 37 50 52 53 # Nap time! -#GPU_ARCHS ?= 35 52 -GPU_ARCHS ?= 35 61 - -GPU_SHAREDMEM ?= 16384 # GPU shared memory size - -CUDA_HOME ?= /usr/local/cuda -CUDA_LIBDIR ?= $(CUDA_HOME)/lib -CUDA_LIBDIR64 ?= $(CUDA_HOME)/lib64 -CUDA_INCDIR ?= $(CUDA_HOME)/include - -ALIGNMENT ?= 4096 # Memory allocation alignment - -#NODEBUG = 1 # Disable debugging mode (use this for production releases) -#TRACE = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp) -#NOCUDA = 1 # Disable CUDA support -#ANY_ARCH = 1 # Disable native architecture compilation -#CUDA_DEBUG = 1 # Enable CUDA debugging (nvcc -G) -#NUMA = 1 # Enable use of numa library for setting affinity of ring memory -#HWLOC = 1 # Enable use of hwloc library for memory binding in udp_capture -#VMA = 1 # Enable use of Mellanox libvma in udp_capture